<!DOCTYPE HTML>
<html lang="en" >
    
    <head>
        
        <meta charset="UTF-8">
        <meta http-equiv="X-UA-Compatible" content="IE=edge" />
        <title>基础：Matplotlib常见图表 | Python 数据分析学习目录</title>
        <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
        <meta name="description" content="">
        <meta name="generator" content="GitBook 2.6.7">
        
        
        <meta name="HandheldFriendly" content="true"/>
        <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
        <meta name="apple-mobile-web-app-capable" content="yes">
        <meta name="apple-mobile-web-app-status-bar-style" content="black">
        <link rel="apple-touch-icon-precomposed" sizes="152x152" href="../../gitbook/images/apple-touch-icon-precomposed-152.png">
        <link rel="shortcut icon" href="../../gitbook/images/favicon.ico" type="image/x-icon">
        
    <link rel="stylesheet" href="../../gitbook/style.css">
    
        
        <link rel="stylesheet" href="../../gitbook/plugins/gitbook-plugin-highlight/website.css">
        
    
        
        <link rel="stylesheet" href="../../gitbook/plugins/gitbook-plugin-search/search.css">
        
    
        
        <link rel="stylesheet" href="../../gitbook/plugins/gitbook-plugin-fontsettings/website.css">
        
    
    

        
    
    
    <link rel="next" href="../../Python可视化/绘图库-Matplotlib/Matplotlib常见设置和操作.html" />
    
    
    <link rel="prev" href="../../Python可视化/绘图库-Matplotlib.html" />
    

        
    </head>
    <body>
        
        
    <div class="book"
        data-level="5.1"
        data-chapter-title="基础：Matplotlib常见图表"
        data-filepath="Python可视化/绘图库-Matplotlib/Matplotlib常见图表.md"
        data-basepath="../.."
        data-revision="Wed Oct 24 2018 21:30:49 GMT+0800 (中国标准时间)"
        data-innerlanguage="">
    

<div class="book-summary">
    <nav role="navigation">
        <ul class="summary">
            
            
            
            

            

            
    
        <li class="chapter " data-level="0" data-path="index.html">
            
                
                    <a href="../../index.html">
                
                        <i class="fa fa-check"></i>
                        
                        数据分析
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="1" data-path="Python数据分析序言/内容序言.html">
            
                
                    <a href="../../Python数据分析序言/内容序言.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>1.</b>
                        
                        Python数据分析内容
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="2" data-path="python数据分析环境和工具/Python数据分析相关.html">
            
                
                    <a href="../../python数据分析环境和工具/Python数据分析相关.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.</b>
                        
                        python数据分析环境和工具
                    </a>
            
            
            <ul class="articles">
                
    
        <li class="chapter " data-level="2.1" data-path="python数据分析环境和工具/1Python数据课程软件和环境安装.html">
            
                
                    <a href="../../python数据分析环境和工具/1Python数据课程软件和环境安装.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.1.</b>
                        
                        Python数据课程 软件和环境安装
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="2.2" data-path="python数据分析环境和工具/2python发行版.html">
            
                
                    <a href="../../python数据分析环境和工具/2python发行版.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.2.</b>
                        
                        python发行版
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="2.3" data-path="python数据分析环境和工具/5交互式编辑器-JupyterNotebook.html">
            
                
                    <a href="../../python数据分析环境和工具/5交互式编辑器-JupyterNotebook.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.3.</b>
                        
                        交互式编辑器-JupyterNotebook
                    </a>
            
            
            <ul class="articles">
                
    
        <li class="chapter " data-level="2.3.1" data-path="python数据分析环境和工具/5.1Jupyter-notebook拓展应用.html">
            
                
                    <a href="../../python数据分析环境和工具/5.1Jupyter-notebook拓展应用.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.3.1.</b>
                        
                        Jupyter-notebook拓展应用
                    </a>
            
            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="2.4" data-path="python数据分析环境和工具/包和环境管理器：conda.html">
            
                
                    <a href="../../python数据分析环境和工具/包和环境管理器：conda.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.4.</b>
                        
                        包和环境管理器：conda
                    </a>
            
            
            <ul class="articles">
                
    
        <li class="chapter " data-level="2.4.1" data-path="python数据分析环境和工具/pip和Virtualenv.html">
            
                
                    <a href="../../python数据分析环境和工具/pip和Virtualenv.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.4.1.</b>
                        
                        pip和Virtualenv
                    </a>
            
            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="2.5" data-path="python数据分析环境和工具/3Markdown.html">
            
                
                    <a href="../../python数据分析环境和工具/3Markdown.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.5.</b>
                        
                        标记语言：Markdown
                    </a>
            
            
            <ul class="articles">
                
    
        <li class="chapter " data-level="2.5.1" data-path="python数据分析环境和工具/4Markdown语法.html">
            
                
                    <a href="../../python数据分析环境和工具/4Markdown语法.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.5.1.</b>
                        
                        Markdown语法
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="2.5.2" data-path="python数据分析环境和工具/6Gitbook文档.html">
            
                
                    <a href="../../python数据分析环境和工具/6Gitbook文档.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.5.2.</b>
                        
                        文档管理工具-Gitbook
                    </a>
            
            
        </li>
    

            </ul>
            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="3" data-path="数据分析库的初步认识/index.html">
            
                
                    <a href="../../数据分析库的初步认识/index.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>3.</b>
                        
                        数据分析库-Pandas
                    </a>
            
            
            <ul class="articles">
                
    
        <li class="chapter " data-level="3.1" data-path="数据分析库的初步认识/Pandas创建.html">
            
                
                    <a href="../../数据分析库的初步认识/Pandas创建.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>3.1.</b>
                        
                        pandas
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="3.2" data-path="数据分析库的初步认识/Series创建.html">
            
                
                    <a href="../../数据分析库的初步认识/Series创建.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>3.2.</b>
                        
                        Series
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="3.3" data-path="数据分析库的初步认识/DataFrame创建.html">
            
                
                    <a href="../../数据分析库的初步认识/DataFrame创建.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>3.3.</b>
                        
                        DataFrame对象-创建
                    </a>
            
            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="4" >
            
            <span><b>4.</b> 数据分析库的操作</span>
            
            
            <ul class="articles">
                
    
        <li class="chapter " data-level="4.1" data-path="数据分析库的操作/1DataFrame查询1-整体.html">
            
                
                    <a href="../../数据分析库的操作/1DataFrame查询1-整体.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>4.1.</b>
                        
                        DataFrame查询1-整体
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="4.2" data-path="数据分析库的操作/2DataFrame查询2-专用查询.html">
            
                
                    <a href="../../数据分析库的操作/2DataFrame查询2-专用查询.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>4.2.</b>
                        
                        DataFrame查询2-专用查询
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="4.3" data-path="数据分析库的操作/3DataFrame查询3-专有查询：过滤查询.html">
            
                
                    <a href="../../数据分析库的操作/3DataFrame查询3-专有查询：过滤查询.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>4.3.</b>
                        
                        DataFrame查询3-专有查询：过滤查询
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="4.4" data-path="数据分析库的操作/4Pandas对象的数据操作：增删改查.html">
            
                
                    <a href="../../数据分析库的操作/4Pandas对象的数据操作：增删改查.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>4.4.</b>
                        
                        Pandas对象的数据操作：增删改查
                    </a>
            
            
            <ul class="articles">
                
    
        <li class="chapter " data-level="4.4.1" data-path="数据分析库的操作/5Pandas数据操作：其他操作.html">
            
                
                    <a href="../../数据分析库的操作/5Pandas数据操作：其他操作.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>4.4.1.</b>
                        
                        Pandas数据操作：其他操作
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="4.4.2" data-path="数据分析库的操作/6Pandas数据存取.html">
            
                
                    <a href="../../数据分析库的操作/6Pandas数据存取.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>4.4.2.</b>
                        
                        Pandas数据存取
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="4.4.3" data-path="数据分析库的操作/7Pandas数据运算.html">
            
                
                    <a href="../../数据分析库的操作/7Pandas数据运算.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>4.4.3.</b>
                        
                        Pandas数据运算
                    </a>
            
            
            <ul class="articles">
                
    
        <li class="chapter " data-level="4.4.3.1" data-path="数据分析库的操作/7.1Pandas数据运算拓展.html">
            
                
                    <a href="../../数据分析库的操作/7.1Pandas数据运算拓展.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>4.4.3.1.</b>
                        
                        Pandas数据运算-拓展
                    </a>
            
            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="4.4.4" data-path="数据分析库的操作/8Pandas分组聚合1.html">
            
                
                    <a href="../../数据分析库的操作/8Pandas分组聚合1.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>4.4.4.</b>
                        
                        Pandas分组聚合1
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="4.4.5" data-path="数据分析库的操作/9Pandas分组聚合2.html">
            
                
                    <a href="../../数据分析库的操作/9Pandas分组聚合2.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>4.4.5.</b>
                        
                        Pandas分组聚合2
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="4.4.6" data-path="数据分析库的操作/10Pandas数据规整-清理.html">
            
                
                    <a href="../../数据分析库的操作/10Pandas数据规整-清理.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>4.4.6.</b>
                        
                        Pandas数据规整-清理
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="4.4.7" data-path="数据分析库的操作/11Pandas数据规整-转换.html">
            
                
                    <a href="../../数据分析库的操作/11Pandas数据规整-转换.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>4.4.7.</b>
                        
                        Pandas数据规整-转换
                    </a>
            
            
            <ul class="articles">
                
    
        <li class="chapter " data-level="4.4.7.1" data-path="数据分析库的操作/14Pandas数据规整-转换-离散化和面元划分.html">
            
                
                    <a href="../../数据分析库的操作/14Pandas数据规整-转换-离散化和面元划分.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>4.4.7.1.</b>
                        
                        离散化和面元划分
                    </a>
            
            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="4.4.8" data-path="数据分析库的操作/16Pandas数据规整-合并.html">
            
                
                    <a href="../../数据分析库的操作/16Pandas数据规整-合并.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>4.4.8.</b>
                        
                        Pandas数据规整-合并
                    </a>
            
            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="4.5" data-path="数据分析库的操作/13Pandas数据规整-重塑和轴向旋转.html">
            
                
                    <a href="../../数据分析库的操作/13Pandas数据规整-重塑和轴向旋转.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>4.5.</b>
                        
                        Pandas数据规整-重塑和轴向旋转
                    </a>
            
            
            <ul class="articles">
                
    
        <li class="chapter " data-level="4.5.1" data-path="数据分析库的操作/13.1透视表和交叉表.html">
            
                
                    <a href="../../数据分析库的操作/13.1透视表和交叉表.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>4.5.1.</b>
                        
                        透视表和交叉表
                    </a>
            
            
        </li>
    

            </ul>
            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="5" data-path="Python可视化/绘图库-Matplotlib.html">
            
                
                    <a href="../../Python可视化/绘图库-Matplotlib.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>5.</b>
                        
                        Python可视化
                    </a>
            
            
            <ul class="articles">
                
    
        <li class="chapter active" data-level="5.1" data-path="Python可视化/绘图库-Matplotlib/Matplotlib常见图表.html">
            
                
                    <a href="../../Python可视化/绘图库-Matplotlib/Matplotlib常见图表.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>5.1.</b>
                        
                        基础：Matplotlib常见图表
                    </a>
            
            
            <ul class="articles">
                
    
        <li class="chapter " data-level="5.1.1" data-path="Python可视化/绘图库-Matplotlib/Matplotlib常见设置和操作.html">
            
                
                    <a href="../../Python可视化/绘图库-Matplotlib/Matplotlib常见设置和操作.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>5.1.1.</b>
                        
                        Matplotlib常见设置和操作
                    </a>
            
            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="5.2" data-path="Python可视化/绘图库-Matplotlib/1Matplotlib-绘图区域.html">
            
                
                    <a href="../../Python可视化/绘图库-Matplotlib/1Matplotlib-绘图区域.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>5.2.</b>
                        
                        提升：绘图区域
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="5.3" data-path="Python可视化/绘图库-Matplotlib/2Matplotlib-图像组件.html">
            
                
                    <a href="../../Python可视化/绘图库-Matplotlib/2Matplotlib-图像组件.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>5.3.</b>
                        
                        提升：绘图组件
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="5.4" data-path="Python可视化/绘图库-Matplotlib/3Matplotlib-高级绘图.html">
            
                
                    <a href="../../Python可视化/绘图库-Matplotlib/3Matplotlib-高级绘图.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>5.4.</b>
                        
                        拓展：高级绘图
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="5.5" data-path="Python可视化/绘图库-Matplotlib/4数学计算展示图像.html">
            
                
                    <a href="../../Python可视化/绘图库-Matplotlib/4数学计算展示图像.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>5.5.</b>
                        
                        拓展：数学计算展示图像
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="5.6" data-path="Python可视化/绘图库-Matplotlib/5注意事项.html">
            
                
                    <a href="../../Python可视化/绘图库-Matplotlib/5注意事项.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>5.6.</b>
                        
                        拓展：注意事项
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="5.7" data-path="Python可视化/绘图库-Matplotlib/6pylab.html">
            
                
                    <a href="../../Python可视化/绘图库-Matplotlib/6pylab.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>5.7.</b>
                        
                        拓展：pylab
                    </a>
            
            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="6" data-path="数据分析必备知识点/数据分析必备知识点汇集.html">
            
                
                    <a href="../../数据分析必备知识点/数据分析必备知识点汇集.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>6.</b>
                        
                        数据分析必备知识点
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="7" data-path="数据分析必备知识点/数据分析流程.html">
            
                
                    <a href="../../数据分析必备知识点/数据分析流程.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>7.</b>
                        
                        数据分析流程
                    </a>
            
            
        </li>
    


            
            <li class="divider"></li>
            <li>
                <a href="https://www.gitbook.com" target="blank" class="gitbook-link">
                    Published with GitBook
                </a>
            </li>
            
        </ul>
    </nav>
</div>

    <div class="book-body">
        <div class="body-inner">
            <div class="book-header" role="navigation">
    <!-- Actions Left -->
    

    <!-- Title -->
    <h1>
        <i class="fa fa-circle-o-notch fa-spin"></i>
        <a href="../../" >Python 数据分析学习目录</a>
    </h1>
</div>

            <div class="page-wrapper" tabindex="-1" role="main">
                <div class="page-inner">
                
                
                    <section class="normal" id="section-">
                    
                        <h1 id="matplotlib&#x5E38;&#x89C1;&#x56FE;&#x8868;">Matplotlib&#x5E38;&#x89C1;&#x56FE;&#x8868;</h1>
<hr>
<p>Matplotlib&#x7ED8;&#x56FE;&#x4E00;&#x822C;&#x7528;&#x4E8E;&#x6570;&#x636E;&#x53EF;&#x89C6;&#x5316;</p>
<ul>
<li>&#x5E38;&#x7528;&#x7684;&#x56FE;&#x8868;&#x6709;&#xFF1A;</li>
<li>&#x6298;&#x7EBF;&#x56FE;</li>
<li>&#x6563;&#x70B9;&#x56FE;&#xFF0F;&#x6C14;&#x6CE1;&#x56FE;</li>
<li>&#x6761;&#x5F62;&#x56FE;&#xFF0F;&#x67F1;&#x72B6;&#x56FE;</li>
<li>&#x997C;&#x56FE;</li>
<li>&#x76F4;&#x65B9;&#x56FE;</li>
<li>&#x7BB1;&#x7EBF;&#x56FE;</li>
<li>&#x70ED;&#x529B;&#x56FE;</li>
</ul>
<p>&#x9700;&#x8981;&#x5B66;&#x4E60;&#x7684;&#x4E0D;&#x53EA;&#x662F;&#x5982;&#x4F55;&#x7ED8;&#x56FE;&#xFF0C;&#x66F4;&#x8981;&#x77E5;&#x9053;&#x4EC0;&#x4E48;&#x6837;&#x7684;&#x6570;&#x636E;&#x7528;&#x4EC0;&#x4E48;&#x56FE;&#x8868;&#x5C55;&#x793A;&#x6548;&#x679C;&#x6700;&#x597D;</p>
<pre><code class="lang-python"><span class="hljs-comment">#&#x7ED8;&#x56FE;&#x524D;&#x5148;&#x8F7D;&#x5165;&#x5E93;</span>

<span class="hljs-keyword">import</span> matplotlib.pyplot <span class="hljs-keyword">as</span> plt
plt.rcParams[<span class="hljs-string">&apos;font.family&apos;</span>] = [<span class="hljs-string">&apos;Arial Unicode MS&apos;</span>, <span class="hljs-string">&apos;Microsoft Yahei&apos;</span>, <span class="hljs-string">&apos;SimHei&apos;</span>, <span class="hljs-string">&apos;sans-serif&apos;</span>] <span class="hljs-comment">#  &#x5168;&#x5C40;&#x8BBE;&#x7F6E;&#x652F;&#x6301;&#x4E2D;&#x6587;&#x5B57;&#x4F53;&#xFF0C;&#x9ED8;&#x8BA4; sans-serif</span>
</code></pre>
<hr>
<h1 id="&#x6298;&#x7EBF;&#x56FE;">&#x6298;&#x7EBF;&#x56FE;</h1>
<p>&#x6298;&#x7EBF;&#x56FE;&#xFF08;&#x5750;&#x6807;&#x7CFB;&#x56FE;&#xFF09;</p>
<p>&#x6298;&#x7EBF;&#x56FE;&#x7528;&#x4E8E;&#x663E;&#x793A;&#x968F;&#x65F6;&#x95F4;&#x6216;&#x6709;&#x5E8F;&#x7C7B;&#x522B;&#x7684;&#x53D8;&#x5316;&#x8D8B;&#x52BF;&#xFF0C; &#x4E3B;&#x8981;&#x770B;&#x6570;&#x636E;&#x53D8;&#x5316;&#x8D8B;&#x52BF;</p>
<pre><code class="lang-python">plt.plot([<span class="hljs-number">3</span>,<span class="hljs-number">5</span>,<span class="hljs-number">7</span>,<span class="hljs-number">1</span>])  <span class="hljs-comment">#&#x53EA;&#x6709;&#x4E00;&#x4E2A;&#x6570;&#x636E;&#xFF0C;&#x9ED8;&#x8BA4;y&#x8F74;&#x6570;&#x636E;&#xFF08;x&#x8F74;&#x81EA;&#x589E;&#xFF09;</span>
</code></pre>
<pre><code>[&lt;matplotlib.lines.Line2D at 0x4a8a668&gt;]
</code></pre><p><img src="images/output_3_1.png" alt="png"></p>
<pre><code class="lang-python">plt.plot(
    [<span class="hljs-number">3</span>,<span class="hljs-number">5</span>,<span class="hljs-number">7</span>,<span class="hljs-number">1</span>,<span class="hljs-number">4</span>],  <span class="hljs-comment"># x&#x8F74;</span>
    [<span class="hljs-number">3</span>,<span class="hljs-number">7</span>,<span class="hljs-number">9</span>,<span class="hljs-number">3</span>,<span class="hljs-number">1</span>],  <span class="hljs-comment">#y &#x8F74;</span>
    color=<span class="hljs-string">&apos;green&apos;</span>,  <span class="hljs-comment">#&#x7EBF;&#x6761;&#x989C;&#x8272;</span>
    linewidth=<span class="hljs-number">1</span>,  <span class="hljs-comment">#&#x7EBF;&#x6761;&#x7C97;&#x7EC6;</span>
    linestyle=<span class="hljs-string">&apos;-.&apos;</span>,<span class="hljs-comment">#&#x7EBF;&#x6761;&#x6837;&#x5F0F;</span>

    marker= <span class="hljs-string">&apos;^&apos;</span>,   <span class="hljs-comment">#&#x6807;&#x8BB0;&#x6837;&#x5F0F;</span>
    markersize = <span class="hljs-number">10</span>,  <span class="hljs-comment">#&#x6807;&#x8BB0;&#x5C3A;&#x5BF8;</span>
    markerfacecolor = <span class="hljs-string">&apos;r&apos;</span>,
    alpha = <span class="hljs-number">0.3</span>,  <span class="hljs-comment">#&#x900F;&#x660E;&#x5EA6;</span>
)
</code></pre>
<pre><code>[&lt;matplotlib.lines.Line2D at 0x7eade48&gt;]
</code></pre><p><img src="images/output_4_1.png" alt="png"></p>
<h1 id="&#x7EBF;&#x6761;&#x548C;&#x6807;&#x8BB0;&#x8282;&#x70B9;&#x683C;&#x5F0F;&#x5B57;&#x7B26;">&#x7EBF;&#x6761;&#x548C;&#x6807;&#x8BB0;&#x8282;&#x70B9;&#x683C;&#x5F0F;&#x5B57;&#x7B26;</h1>
<p>&#x5982;&#x679C;&#x4E0D;&#x8BBE;&#x7F6E;&#x989C;&#x8272;&#xFF0C;&#x7CFB;&#x7EDF;&#x9ED8;&#x8BA4;&#x4F1A;&#x53D6;&#x4E00;&#x4E2A;&#x4E0D;&#x540C;&#x989C;&#x8272;&#x6765;&#x533A;&#x522B;&#x7EBF;&#x6761; &#x56FE;&#x50CF;&#x6253;&#x5370;&#x65F6;&#xFF0C;&#x9ED1;&#x767D;&#x6253;&#x5370;&#x673A;&#x4E0D;&#x80FD;&#x533A;&#x5206;&#x989C;&#x8272;,&#x9700;&#x8981;&#x98CE;&#x683C;&#x533A;&#x5206;</p>
<table>
<thead>
<tr>
<th>&#x989C;&#x8272;&#x5B57;&#x7B26;</th>
<th>&#x98CE;&#x683C;&#x5B57;&#x7B26;</th>
<th>&#x6807;&#x8BB0;&#x5B57;&#x7B26;1</th>
<th>&#x6807;&#x8BB0;&#x5B57;&#x7B26;2</th>
</tr>
</thead>
<tbody>
<tr>
<td>r &#x7EA2;&#x8272;</td>
<td>- &#x5B9E;&#x7EBF;</td>
<td>o &#x5B9E;&#x5FC3;&#x5708;&#x6807;&#x8BB0;</td>
<td>1 &#x4E0B;&#x82B1;&#x4E09;&#x89D2;&#x6807;&#x8BB0;</td>
</tr>
<tr>
<td>g &#x7EFF;&#x8272;</td>
<td>-- &#x865A;&#x7EBF;,&#x7834;&#x6298;&#x7EBF;</td>
<td>. &#x70B9;&#x6807;&#x8BB0;</td>
<td>2 &#x4E0A;&#x82B1;&#x4E09;&#x89D2;&#x6807;&#x8BB0;</td>
</tr>
<tr>
<td>b &#x84DD;&#x8272;</td>
<td>-. &#x70B9;&#x5212;&#x7EBF;</td>
<td>, &#x50CF;&#x7D20;&#x6807;&#x8BB0;,&#x6781;&#x5C0F;&#x7684;&#x70B9;</td>
<td>3 &#x5DE6;&#x82B1;&#x4E09;&#x89D2;&#x6807;&#x8BB0;</td>
</tr>
<tr>
<td>w &#x767D;&#x8272;</td>
<td>: &#x70B9;&#x865A;&#x7EBF;,&#x865A;&#x7EBF;</td>
<td>v &#x5012;&#x4E09;&#x89D2;&#x6807;&#x8BB0;</td>
<td>4 &#x53F3;&#x82B1;&#x4E09;&#x89D2;&#x6807;&#x8BB0;</td>
</tr>
<tr>
<td></td>
<td>&apos;&apos;  &#x7559;&#x7A7A;&#x6216;&#x7A7A;&#x683C;,&#x65E0;&#x7EBF;&#x6761;</td>
<td>^ &#x4E0A;&#x4E09;&#x89D2;&#x6807;&#x8BB0;</td>
<td>s &#x5B9E;&#x5FC3;&#x65B9;&#x5F62;&#x6807;&#x8BB0;</td>
</tr>
<tr>
<td>c &#x9752;&#x8272;</td>
<td></td>
<td>&gt; &#x53F3;&#x4E09;&#x89D2;&#x6807;&#x8BB0;</td>
<td>p &#x5B9E;&#x5FC3;&#x4E94;&#x89D2;&#x6807;&#x8BB0;</td>
</tr>
<tr>
<td>m &#x6D0B;&#x7EA2;</td>
<td></td>
<td>&lt; &#x5DE6;&#x4E09;&#x89D2;&#x6807;&#x8BB0;</td>
<td>h &#x7AD6;&#x516D;&#x8FB9;&#x5F62;&#x6807;&#x8BB0;</td>
</tr>
<tr>
<td>y &#x9EC4;&#x8272;</td>
<td></td>
<td>* &#x661F;&#x5F62;&#x6807;&#x8BB0;</td>
<td>H &#x6A2A;&#x516D;&#x8FB9;&#x5F62;&#x6807;&#x8BB0;</td>
</tr>
<tr>
<td>k &#x9ED1;&#x8272;</td>
<td></td>
<td>+ &#x5341;&#x5B57;&#x6807;&#x8BB0;</td>
<td>D &#x83F1;&#x5F62;&#x6807;&#x8BB0;</td>
</tr>
<tr>
<td></td>
<td></td>
<td>x x&#x6807;&#x8BB0;</td>
<td>d &#x7626;&#x83F1;&#x5F62;&#x6807;&#x8BB0;</td>
</tr>
<tr>
<td>#00ff00 16&#x8FDB;&#x5236;</td>
<td></td>
<td>`</td>
<td>` &#x5782;&#x76F4;&#x7EBF;&#x6807;&#x8BB0; </td>
</tr>
<tr>
<td>0.8 &#x7070;&#x5EA6;&#x503C;&#x5B57;&#x7B26;&#x4E32;</td>
<td></td>
</tr>
</tbody>
</table>
<h2 id="&#x6848;&#x4F8B;&#xFF1A;&#x7ED8;&#x5236;2017&#x5E74;7&#x6708;&#x56FD;&#x9645;&#x5916;&#x6C47;&#x5E02;&#x573A;&#x7F8E;&#x5143;&#xFF0F;&#x4EBA;&#x6C11;&#x5E01;&#x6C47;&#x7387;&#x8D70;&#x52BF;&#x56FE;">&#x6848;&#x4F8B;&#xFF1A;&#x7ED8;&#x5236;2017&#x5E74;7&#x6708;&#x56FD;&#x9645;&#x5916;&#x6C47;&#x5E02;&#x573A;&#x7F8E;&#x5143;&#xFF0F;&#x4EBA;&#x6C11;&#x5E01;&#x6C47;&#x7387;&#x8D70;&#x52BF;&#x56FE;</h2>
<p>&#x65F6;&#x95F4;    &#x6536;&#x76D8;&#x4EF7;</p>
<p>2017&#x5E74;7&#x6708;3&#x65E5;    6.8007</p>
<p>2017&#x5E74;7&#x6708;4&#x65E5;    6.8007</p>
<p>2017&#x5E74;7&#x6708;5&#x65E5;    6.8015</p>
<p>2017&#x5E74;7&#x6708;6&#x65E5;    6.8015</p>
<p>2017&#x5E74;7&#x6708;7&#x65E5;    6.8060</p>
<p>2017&#x5E74;7&#x6708;10&#x65E5;    6.8036</p>
<p>2017&#x5E74;7&#x6708;11&#x65E5;    6.8025</p>
<p>2017&#x5E74;7&#x6708;12&#x65E5;    6.7877</p>
<p>2017&#x5E74;7&#x6708;13&#x65E5;    6.7835</p>
<p>2017&#x5E74;7&#x6708;14&#x65E5;    6.7758</p>
<p>2017&#x5E74;7&#x6708;17&#x65E5;    6.7700</p>
<p>2017&#x5E74;7&#x6708;18&#x65E5;    6.7463</p>
<p>2017&#x5E74;7&#x6708;19&#x65E5;    6.7519</p>
<p>2017&#x5E74;7&#x6708;20&#x65E5;    6.7595</p>
<p>2017&#x5E74;7&#x6708;21&#x65E5;    6.7669</p>
<p>2017&#x5E74;7&#x6708;24&#x65E5;    6.7511</p>
<p>2017&#x5E74;7&#x6708;25&#x65E5;    6.7511</p>
<p>2017&#x5E74;7&#x6708;26&#x65E5;    6.7539</p>
<p>2017&#x5E74;7&#x6708;27&#x65E5;    6.7430</p>
<p>2017&#x5E74;7&#x6708;28&#x65E5;    6.7374</p>
<p>2017&#x5E74;7&#x6708;31&#x65E5;    6.7265</p>
<pre><code class="lang-python">plt.plot(
    range(<span class="hljs-number">3</span>,<span class="hljs-number">24</span>),  <span class="hljs-comment"># x&#x8F74;</span>
    [<span class="hljs-number">6.800</span>,<span class="hljs-number">6.800</span>,<span class="hljs-number">6.801</span>,<span class="hljs-number">6.801</span>,<span class="hljs-number">6.8060</span>,<span class="hljs-number">6.8036</span>,<span class="hljs-number">6.8025</span>,<span class="hljs-number">6.7877</span>,<span class="hljs-number">6.7835</span>,<span class="hljs-number">6.7758</span>,<span class="hljs-number">6.7700</span>,<span class="hljs-number">6.7463</span>,<span class="hljs-number">6.7519</span>,<span class="hljs-number">6.7595</span>,<span class="hljs-number">6.7669</span>,<span class="hljs-number">6.7511</span>,<span class="hljs-number">6.7511</span>,<span class="hljs-number">6.7539</span>,<span class="hljs-number">6.7430</span>,<span class="hljs-number">6.7374</span>,<span class="hljs-number">6.7265</span>],  <span class="hljs-comment">#y &#x8F74;</span>
    color=<span class="hljs-string">&apos;red&apos;</span>,  <span class="hljs-comment">#&#x7EBF;&#x6761;&#x989C;&#x8272;</span>
    linewidth=<span class="hljs-number">1</span>,  <span class="hljs-comment">#&#x7EBF;&#x6761;&#x7C97;&#x7EC6;</span>
    linestyle=<span class="hljs-string">&apos;-.&apos;</span>,<span class="hljs-comment">#&#x7EBF;&#x6761;&#x6837;&#x5F0F;</span>

    marker= <span class="hljs-string">&apos;o&apos;</span>,   <span class="hljs-comment">#&#x6807;&#x8BB0;&#x6837;&#x5F0F;</span>
    markersize = <span class="hljs-number">10</span>,  <span class="hljs-comment">#&#x6807;&#x8BB0;&#x5C3A;&#x5BF8;</span>
    markerfacecolor = <span class="hljs-string">&apos;yellow&apos;</span>,
    <span class="hljs-comment">#alpha = 0.3,  #&#x900F;&#x660E;&#x5EA6;</span>

)
</code></pre>
<pre><code>[&lt;matplotlib.lines.Line2D at 0x973e9b0&gt;]
</code></pre><p><img src="images/output_7_1.png" alt="png"></p>
<pre><code class="lang-python"><span class="hljs-comment">#&#x65E5;&#x671F;</span>
date = [<span class="hljs-number">3</span>,<span class="hljs-number">4</span>,<span class="hljs-number">5</span>,<span class="hljs-number">6</span>,<span class="hljs-number">7</span>,<span class="hljs-number">10</span>,<span class="hljs-number">11</span>,<span class="hljs-number">12</span>,<span class="hljs-number">13</span>,<span class="hljs-number">14</span>,<span class="hljs-number">17</span>,<span class="hljs-number">18</span>,<span class="hljs-number">19</span>,<span class="hljs-number">20</span>,<span class="hljs-number">21</span>,<span class="hljs-number">24</span>,<span class="hljs-number">25</span>,<span class="hljs-number">26</span>,<span class="hljs-number">27</span>,<span class="hljs-number">28</span>,<span class="hljs-number">31</span>]
<span class="hljs-comment">#&#x6C47;&#x7387;</span>
eurcny = [<span class="hljs-number">6.8007</span>,<span class="hljs-number">6.8007</span>,<span class="hljs-number">6.8015</span>,<span class="hljs-number">6.8015</span>,<span class="hljs-number">6.8060</span>,<span class="hljs-number">6.8036</span>,<span class="hljs-number">6.8025</span>,<span class="hljs-number">6.7877</span>,<span class="hljs-number">6.7835</span>,<span class="hljs-number">6.7758</span>,<span class="hljs-number">6.7700</span>,<span class="hljs-number">6.7463</span>,<span class="hljs-number">6.7519</span>,<span class="hljs-number">6.7595</span>,<span class="hljs-number">6.7669</span>,<span class="hljs-number">6.7511</span>,<span class="hljs-number">6.7511</span>,<span class="hljs-number">6.7539</span>,<span class="hljs-number">6.7430</span>,<span class="hljs-number">6.7374</span>,<span class="hljs-number">6.7265</span>]
plt.plot(
    date,
    eurcny,

    color = <span class="hljs-string">&apos;g&apos;</span>,
    linestyle = <span class="hljs-string">&apos;-.&apos;</span>,
    linewidth = <span class="hljs-number">2</span>,

    marker = <span class="hljs-string">&apos;o&apos;</span>,
    markersize = <span class="hljs-number">7</span>,
    markerfacecolor = <span class="hljs-string">&apos;#ff00ff&apos;</span>
    )
plt.plot(eurcny)
</code></pre>
<pre><code>[&lt;matplotlib.lines.Line2D at 0x94e2a90&gt;]
</code></pre><p><img src="images/output_8_1.png" alt="png"></p>
<hr>
<h1 id="&#x6563;&#x70B9;&#x56FE;&#xFF0F;&#x6C14;&#x6CE1;&#x56FE;">&#x6563;&#x70B9;&#x56FE;&#xFF0F;&#x6C14;&#x6CE1;&#x56FE;</h1>
<p>&#x6563;&#x70B9;&#x56FE;&#x53EF;&#x4EE5;&#x663E;&#x793A;&#x82E5;&#x5E72;&#x6570;&#x636E;&#x7CFB;&#x5217;&#x4E2D;&#x5404;&#x6570;&#x503C;&#x4E4B;&#x95F4;&#x662F;&#x5426;&#x5B58;&#x5728;&#x76F8;&#x5173;&#x6027;</p>
<p>&#x5750;&#x6807;&#x7CFB;&#x4E2D;,&#x6BCF;&#x4E2A;&#x503C;&#x7528;&#x4E00;&#x4E2A;&#x70B9;&#xFF08;x&#x8F74;&#xFF0C;y&#x8F74;&#x786E;&#x5B9A;&#xFF09;&#x8868;&#x793A;</p>
<pre><code class="lang-python"><span class="hljs-comment"># &#x6570;&#x636E;</span>
x = [<span class="hljs-number">1</span>,<span class="hljs-number">3</span>,<span class="hljs-number">5</span>,<span class="hljs-number">7</span>,<span class="hljs-number">9</span>,<span class="hljs-number">11</span>,<span class="hljs-number">13</span>,<span class="hljs-number">15</span>,<span class="hljs-number">17</span>]
y = [<span class="hljs-number">2</span>,-<span class="hljs-number">5</span>,<span class="hljs-number">19</span>,<span class="hljs-number">3</span>,<span class="hljs-number">5</span>,<span class="hljs-number">8</span>,<span class="hljs-number">12</span>,<span class="hljs-number">6</span>,<span class="hljs-number">1</span>]

<span class="hljs-comment"># &#x7ED8;&#x56FE;</span>
plt.scatter(x, y)

plt.show()
</code></pre>
<p><img src="images/output_10_0.png" alt="png"></p>
<p>&#x6563;&#x70B9;&#x56FE;&#x5E38;&#x89C1;&#x6837;&#x5F0F;</p>
<pre><code class="lang-python">plt.scatter(
    x, <span class="hljs-comment"># x&#x8F74;</span>
    y, <span class="hljs-comment"># y&#x8F74;</span>

    color=<span class="hljs-string">&apos;r&apos;</span>, <span class="hljs-comment"># &#x989C;&#x8272;</span>
    marker=<span class="hljs-string">&apos;^&apos;</span>, <span class="hljs-comment"># &#x6837;&#x5F0F;</span>
    linewidth=<span class="hljs-number">20</span>, <span class="hljs-comment"># &#x7EBF;&#x5BBD;</span>
    alpha=<span class="hljs-number">0.3</span>, <span class="hljs-comment"># &#x900F;&#x660E;&#x5EA6;</span>
    <span class="hljs-comment"># &#x6563;&#x70B9;&#x5927;&#x5C0F;&#xFF0C;&#x7528;&#x4E8E;&#x7ED8;&#x5236;&#x6C14;&#x6CE1;&#x56FE;&#xFF0C;&#x5728;&#x6563;&#x70B9;&#x56FE;&#x7684;&#x57FA;&#x7840;&#x4E0A;&#x53C8;&#x589E;&#x52A0;&#x4E86;1&#x4E2A;&#x7EF4;&#x5EA6;</span>
    s = [<span class="hljs-number">10</span>,<span class="hljs-number">30</span>,<span class="hljs-number">50</span>,<span class="hljs-number">70</span>,<span class="hljs-number">100</span>,<span class="hljs-number">200</span>,<span class="hljs-number">300</span>,<span class="hljs-number">400</span>,<span class="hljs-number">500</span>], <span class="hljs-comment"># &#x5355;&#x72EC;&#x8BBE;&#x7F6E;&#x5927;&#x5C0F;</span>
)
<span class="hljs-comment"># &#x7ED8;&#x5236;&#x591A;&#x7C7B;&#x6563;&#x70B9;</span>
plt.scatter([<span class="hljs-number">1</span>,<span class="hljs-number">3</span>,<span class="hljs-number">5</span>,<span class="hljs-number">7</span>,<span class="hljs-number">9</span>], [<span class="hljs-number">2</span>,<span class="hljs-number">4</span>,<span class="hljs-number">6</span>,<span class="hljs-number">8</span>,<span class="hljs-number">10</span>])

plt.show()
</code></pre>
<p><img src="images/output_12_0.png" alt="png"></p>
<pre><code class="lang-python">

</code></pre>
<p><img src="images/output_13_0.png" alt="png"></p>
<h2 id="&#x6848;&#x4F8B;&#xFF1A;&#x53EF;&#x89C6;&#x5316;&#x5C45;&#x6C11;&#x5E74;&#x9F84;&#xFF0F;&#x6536;&#x5165;&#x548C;&#x8D85;&#x5E02;&#x9500;&#x552E;&#x989D;&#x7684;&#x5BF9;&#x5E94;&#x5173;&#x7CFB;">&#x6848;&#x4F8B;&#xFF1A;&#x53EF;&#x89C6;&#x5316;&#x5C45;&#x6C11;&#x5E74;&#x9F84;&#xFF0F;&#x6536;&#x5165;&#x548C;&#x8D85;&#x5E02;&#x9500;&#x552E;&#x989D;&#x7684;&#x5BF9;&#x5E94;&#x5173;&#x7CFB;</h2>
<ul>
<li>&#x6570;&#x636E;&#xFF1A;<ul>
<li>&#x987E;&#x5BA2;&#x5E74;&#x9F84;</li>
<li>&#x987E;&#x5BA2;&#x5E74;&#x6536;&#x5165;</li>
<li>&#x987E;&#x5BA2;&#x5E74;&#x8D2D;&#x7269;&#x91D1;&#x989D;</li>
</ul>
</li>
<li><p>&#x9700;&#x6C42;</p>
<ul>
<li>&#x5206;&#x6790;&#x51FA;&#x8D85;&#x5E02;&#x9500;&#x552E;&#x989D;&#x548C;&#x5C45;&#x6C11;&#x5E74;&#x9F84;&#x3001;&#x6536;&#x5165;&#x7684;&#x5173;&#x7CFB;</li>
<li>&#x89E3;&#x91CA;&#x5173;&#x7CFB;&#x4EA7;&#x751F;&#x7684;&#x539F;&#x56E0;</li>
<li>&#x63D0;&#x51FA;&#x89E3;&#x51B3;&#x5EFA;&#x8BAE;</li>
</ul>
</li>
<li><p>&#x5206;&#x6790;&#x51FA;&#x8D85;&#x5E02;&#x9500;&#x552E;&#x989D;&#x548C;&#x5C45;&#x6C11;&#x5E74;&#x9F84;&#x3001;&#x6536;&#x5165;&#x7684;&#x5173;&#x7CFB;</p>
</li>
</ul>
<p>&#x6570;&#x636E;&#xFF1A;</p>
<p>&#x5E74;&#x9F84;  &#x6536;&#x5165;  &#x9500;&#x552E;&#x989D;</p>
<p>34  350 123</p>
<p>40  450 114</p>
<p>37  169 135</p>
<p>30  189 139</p>
<p>44  183 117</p>
<p>36  80  121</p>
<p>32  166 133</p>
<p>26  120 140</p>
<p>32  75  133</p>
<p>36  40  133</p>
<p>&#x6570;&#x636E;</p>
<pre><code class="lang-python"><span class="hljs-comment">#&#x5E74;&#x9F84;</span>
age = [<span class="hljs-number">34</span>,<span class="hljs-number">40</span>,<span class="hljs-number">37</span>,<span class="hljs-number">30</span>,<span class="hljs-number">44</span>,<span class="hljs-number">36</span>,<span class="hljs-number">32</span>,<span class="hljs-number">26</span>,<span class="hljs-number">32</span>,<span class="hljs-number">36</span>]
<span class="hljs-comment">#&#x6536;&#x5165;</span>
income = [<span class="hljs-number">350</span>,<span class="hljs-number">450</span>,<span class="hljs-number">169</span>,<span class="hljs-number">189</span>,<span class="hljs-number">183</span>,<span class="hljs-number">80</span>,<span class="hljs-number">166</span>,<span class="hljs-number">120</span>,<span class="hljs-number">75</span>,<span class="hljs-number">40</span>]
<span class="hljs-comment">#&#x9500;&#x552E;&#x989D;</span>
sales = [<span class="hljs-number">123</span>,<span class="hljs-number">114</span>,<span class="hljs-number">135</span>,<span class="hljs-number">139</span>,<span class="hljs-number">117</span>,<span class="hljs-number">121</span>,<span class="hljs-number">133</span>,<span class="hljs-number">140</span>,<span class="hljs-number">133</span>,<span class="hljs-number">133</span>]
</code></pre>
<h2 id="&#x6570;&#x636E;&#x53EF;&#x89C6;&#x5316;">&#x6570;&#x636E;&#x53EF;&#x89C6;&#x5316;</h2>
<p>&#x5206;&#x6790;&#x5E74;&#x9F84;&#x548C;&#x9500;&#x552E;&#x989D;&#x7684;&#x5173;&#x7CFB;</p>
<pre><code class="lang-python">plt.scatter(
    age, <span class="hljs-comment"># x&#x8F74;</span>
    sales, <span class="hljs-comment"># y&#x8F74;</span>

    color=<span class="hljs-string">&apos;r&apos;</span>, <span class="hljs-comment"># &#x989C;&#x8272;</span>
    marker=<span class="hljs-string">&apos;o&apos;</span>, <span class="hljs-comment"># &#x6837;&#x5F0F;</span>
    linewidth=<span class="hljs-number">2</span>, <span class="hljs-comment"># &#x7EBF;&#x5BBD;</span>
    <span class="hljs-comment">#alpha=0.3, # &#x900F;&#x660E;&#x5EA6;</span>
    <span class="hljs-comment"># &#x6563;&#x70B9;&#x5927;&#x5C0F;&#xFF0C;&#x7528;&#x4E8E;&#x7ED8;&#x5236;&#x6C14;&#x6CE1;&#x56FE;&#xFF0C;&#x5728;&#x6563;&#x70B9;&#x56FE;&#x7684;&#x57FA;&#x7840;&#x4E0A;&#x53C8;&#x589E;&#x52A0;&#x4E86;1&#x4E2A;&#x7EF4;&#x5EA6;</span>
    <span class="hljs-comment">#s = [10,30,50,70,100,200,300,400,500], # &#x5355;&#x72EC;&#x8BBE;&#x7F6E;&#x5927;&#x5C0F;</span>
)
</code></pre>
<pre><code>&lt;matplotlib.collections.PathCollection at 0x95ee2b0&gt;
</code></pre><p><img src="images/output_18_1.png" alt="png"></p>
<pre><code class="lang-python">plt.scatter(
    age, <span class="hljs-comment"># x&#x8F74;</span>
    income, <span class="hljs-comment"># y&#x8F74;</span>

    color=<span class="hljs-string">&apos;g&apos;</span>, <span class="hljs-comment"># &#x989C;&#x8272;</span>
    marker=<span class="hljs-string">&apos;o&apos;</span>, <span class="hljs-comment"># &#x6837;&#x5F0F;</span>
    linewidth=<span class="hljs-number">2</span>, <span class="hljs-comment"># &#x7EBF;&#x5BBD;</span>
    <span class="hljs-comment">#alpha=0.3, # &#x900F;&#x660E;&#x5EA6;</span>
    <span class="hljs-comment"># &#x6563;&#x70B9;&#x5927;&#x5C0F;&#xFF0C;&#x7528;&#x4E8E;&#x7ED8;&#x5236;&#x6C14;&#x6CE1;&#x56FE;&#xFF0C;&#x5728;&#x6563;&#x70B9;&#x56FE;&#x7684;&#x57FA;&#x7840;&#x4E0A;&#x53C8;&#x589E;&#x52A0;&#x4E86;1&#x4E2A;&#x7EF4;&#x5EA6;</span>
    <span class="hljs-comment">#s = [10,30,50,70,100,200,300,400,500], # &#x5355;&#x72EC;&#x8BBE;&#x7F6E;&#x5927;&#x5C0F;</span>
)
</code></pre>
<pre><code>&lt;matplotlib.collections.PathCollection at 0x955c5c0&gt;
</code></pre><p><img src="images/output_19_1.png" alt="png"></p>
<pre><code class="lang-python">plt.scatter(
    income, <span class="hljs-comment"># x&#x8F74;</span>
    sales, <span class="hljs-comment"># y&#x8F74;</span>

    color=<span class="hljs-string">&apos;g&apos;</span>, <span class="hljs-comment"># &#x989C;&#x8272;</span>
    marker=<span class="hljs-string">&apos;o&apos;</span>, <span class="hljs-comment"># &#x6837;&#x5F0F;</span>
    linewidth=<span class="hljs-number">2</span>, <span class="hljs-comment"># &#x7EBF;&#x5BBD;</span>
    <span class="hljs-comment">#alpha=0.3, # &#x900F;&#x660E;&#x5EA6;</span>
    <span class="hljs-comment"># &#x6563;&#x70B9;&#x5927;&#x5C0F;&#xFF0C;&#x7528;&#x4E8E;&#x7ED8;&#x5236;&#x6C14;&#x6CE1;&#x56FE;&#xFF0C;&#x5728;&#x6563;&#x70B9;&#x56FE;&#x7684;&#x57FA;&#x7840;&#x4E0A;&#x53C8;&#x589E;&#x52A0;&#x4E86;1&#x4E2A;&#x7EF4;&#x5EA6;</span>
    <span class="hljs-comment">#s = [10,30,50,70,100,200,300,400,500], # &#x5355;&#x72EC;&#x8BBE;&#x7F6E;&#x5927;&#x5C0F;</span>
)
</code></pre>
<pre><code>&lt;matplotlib.collections.PathCollection at 0x956c278&gt;
</code></pre><p><img src="images/output_20_1.png" alt="png"></p>
<h3 id="&#x5206;&#x6790;&#x5E74;&#x9F84;&#x548C;&#x9500;&#x552E;&#x989D;&#x7684;&#x5173;&#x7CFB;">&#x5206;&#x6790;&#x5E74;&#x9F84;&#x548C;&#x9500;&#x552E;&#x989D;&#x7684;&#x5173;&#x7CFB;</h3>
<pre><code class="lang-python">plt.scatter(age,sales)
</code></pre>
<pre><code>&lt;matplotlib.collections.PathCollection at 0x9612da0&gt;
</code></pre><p><img src="images/output_22_1.png" alt="png"></p>
<h3 id="&#x5206;&#x6790;&#x6536;&#x5165;&#x548C;&#x9500;&#x552E;&#x989D;&#x7684;&#x5173;&#x7CFB;">&#x5206;&#x6790;&#x6536;&#x5165;&#x548C;&#x9500;&#x552E;&#x989D;&#x7684;&#x5173;&#x7CFB;</h3>
<pre><code class="lang-python">plt.scatter(income,sales)
</code></pre>
<pre><code>&lt;matplotlib.collections.PathCollection at 0xaec8438&gt;
</code></pre><p><img src="images/output_24_1.png" alt="png"></p>
<pre><code class="lang-python"><span class="hljs-comment"># &#x5C06;&#x4E09;&#x5217;&#x6570;&#x636E;&#x753B;&#x5165;&#x4E00;&#x5F20;&#x56FE;</span>

<span class="hljs-comment"># plt.scatter(age, sales)</span>
<span class="hljs-comment"># plt.scatter(income, sales)</span>
<span class="hljs-comment"># &#x6570;&#x636E;&#x6709;&#x6570;&#x91CF;&#x7EA7;&#x5DEE;&#x5F02;&#xFF0C;&#x4E0D;&#x80FD;&#x76F4;&#x63A5;&#x7ED8;&#x5236;</span>

<span class="hljs-comment"># &#x6563;&#x70B9;&#x56FE;&#x8868;&#x663E;&#x793A;&#x4E09;&#x7EF4;&#x6570;&#x636E;</span>
plt.scatter(
    age, 
    sales,
    s = income,
    alpha=<span class="hljs-number">0.5</span>,
)
</code></pre>
<pre><code>&lt;matplotlib.collections.PathCollection at 0xe4de908&gt;
</code></pre><p><img src="images/output_25_1.png" alt="png"></p>
<hr>
<p>&#x7ED3;&#x8BBA;&#xFF1A;</p>
<ul>
<li>&#x968F;&#x7740;&#x5E74;&#x9F84;&#x7684;&#x589E;&#x52A0;&#xFF0C;&#x9500;&#x552E;&#x989D;&#x9010;&#x6E10;&#x4E0B;&#x964D;</li>
<li>&#x968F;&#x7740;&#x6536;&#x5165;&#x7684;&#x589E;&#x52A0;&#xFF0C;&#x9500;&#x552E;&#x989D;&#x9010;&#x6E10;&#x4E0B;&#x964D;</li>
</ul>
<p>&#x89E3;&#x91CA;&#xFF1A;</p>
<ul>
<li><p>&#x8001;&#x5E74;&#x4EBA;&#x559C;&#x6B22;&#x901B;&#x8D85;&#x5E02;&#xFF0C;&#x4E70;&#x4E9B;&#x6298;&#x6263;&#x5546;&#x54C1;&#xFF0C;&#x6216;&#x8005;&#x83DC;&#x54C1;&#xFF0C;&#x8001;&#x5E74;&#x4EBA;&#x7231;&#x4E70;&#x6253;&#x6298;&#x964D;&#x4EF7;&#x5546;&#x54C1;&#xFF0C;&#x4E0D;&#x613F;&#x591A;&#x82B1;&#x94B1;</p>
</li>
<li><p>&#x9AD8;&#x6536;&#x5165;&#x4EBA;&#x7FA4;&#x6709;&#x81EA;&#x5DF1;&#x7684;&#x9AD8;&#x7AEF;&#x8D2D;&#x7269;&#x6E20;&#x9053;&#xFF0C;&#x5728;&#x666E;&#x901A;&#x8D85;&#x5E02;&#x8D2D;&#x7269;&#x8F83;&#x5C11;</p>
</li>
</ul>
<p>&#x6539;&#x8FDB;&#x5EFA;&#x8BAE;&#xFF1A;</p>
<ul>
<li>&#x8425;&#x9500;&#x9488;&#x5BF9;&#x4EBA;&#x7FA4;&#xFF0C;&#x52A0;&#x5927;&#x8425;&#x9500;&#x529B;&#x5EA6;<ul>
<li>&#x9752;&#x5E74;&#x4EBA;&#xFF0C;25-32&#x5C81;&#x4E4B;&#x95F4;&#x7684;&#x9752;&#x5E74;&#x4EBA;</li>
<li>&#x5E74;&#x6536;&#x5165;20&#x4E07;&#x4EE5;&#x4E0B;&#x7684;&#x4EBA;&#x7FA4;</li>
</ul>
</li>
</ul>
<hr>
<h1 id="&#x6761;&#x5F62;&#x56FE;&#xFF0F;&#x67F1;&#x72B6;&#x56FE;">&#x6761;&#x5F62;&#x56FE;&#xFF0F;&#x67F1;&#x72B6;&#x56FE;</h1>
<ul>
<li>&#x6761;&#x5F62;&#x56FE;&#xFF08;&#x6A2A;&#x5411;&#xFF09;</li>
<li>&#x67F1;&#x72B6;&#x56FE;&#xFF08;&#x7EB5;&#x5411;&#xFF09;</li>
</ul>
<p>&#x6761;&#x5F62;&#x56FE;&#x548C;&#x67F1;&#x72B6;&#x56FE;&#x7528;&#x6765;&#x6BD4;&#x8F83;&#x5404;&#x72EC;&#x7ACB;&#x7C7B;&#x522B;&#x4E0B;&#x7684;&#x67D0;&#x5355;&#x72EC;  <strong>&#x6570;&#x636E;&#x7684;&#x5927;&#x5C0F;</strong></p>
<p>&#x6761;&#x5F62;&#x56FE;</p>
<pre><code class="lang-python">x = [<span class="hljs-number">1</span>,<span class="hljs-number">2</span>,<span class="hljs-number">3</span>,<span class="hljs-number">4</span>,<span class="hljs-number">5</span>]
y = [<span class="hljs-number">3</span>,<span class="hljs-number">6</span>,<span class="hljs-number">1</span>,<span class="hljs-number">8</span>,<span class="hljs-number">2</span>]

<span class="hljs-comment"># &#x67F1;&#x72B6;&#x56FE;&#xFF0C;x&#x8F74;&#x4E3A;&#x5355;&#x4E2A;&#x67F1;&#x5B50;&#xFF0C;y&#x8F74;&#x4E3A;&#x67F1;&#x5B50;&#x9AD8;&#x5EA6;&#xFF0C;Width&#x7528;&#x4E8E;&#x67F1;&#x5B50;&#x7C97;&#x7EC6;</span>
plt.bar(
    x,
    y,
    width=<span class="hljs-number">0.5</span>, <span class="hljs-comment"># &#x6A2A;&#x6761;&#x7C97;&#x7EC6;</span>
    color=<span class="hljs-string">&apos;r&apos;</span>,  <span class="hljs-comment">#&#x989C;&#x8272;</span>
    alpha =<span class="hljs-number">0.6</span>,  <span class="hljs-comment">#&#x900F;&#x660E;&#x5EA6;</span>
)
plt.xticks(x,[<span class="hljs-string">&apos;a&apos;</span>,<span class="hljs-string">&apos;b&apos;</span>,<span class="hljs-string">&apos;c&apos;</span>,<span class="hljs-string">&apos;&#x5C0F;&#x7EFF;&apos;</span>,<span class="hljs-string">&apos;&#x5C0F;&#x7EA2;&apos;</span>])
plt.yticks(y,[<span class="hljs-string">&apos;&#x767D;&#x96EA;&#x539F;&apos;</span>,<span class="hljs-string">&apos;&#x5C0F;&#x767D;&apos;</span>,<span class="hljs-string">&apos;&#x5C0F;&#x9ED1;&apos;</span>,<span class="hljs-string">&apos;&#x5C0F;&#x7EFF;&apos;</span>,<span class="hljs-string">&apos;&#x5C0F;&#x7EA2;&apos;</span>])
</code></pre>
<pre><code>([&lt;matplotlib.axis.YTick at 0xc2e2e10&gt;,
  &lt;matplotlib.axis.YTick at 0xc2e2748&gt;,
  &lt;matplotlib.axis.YTick at 0xc2de710&gt;,
  &lt;matplotlib.axis.YTick at 0xc313208&gt;,
  &lt;matplotlib.axis.YTick at 0xc313710&gt;],
 &lt;a list of 5 Text yticklabel objects&gt;)
</code></pre><p><img src="images/output_28_1.png" alt="png"></p>
<pre><code class="lang-python">plt.barh(
    x,
    y,

    height=<span class="hljs-number">0.5</span>,  <span class="hljs-comment">#&#x7C97;&#x7EC6;</span>

)
</code></pre>
<pre><code>&lt;BarContainer object of 5 artists&gt;
</code></pre><p><img src="images/output_29_1.png" alt="png"></p>
<pre><code class="lang-python"><span class="hljs-comment"># &#x6761;&#x5F62;&#x56FE;&#xFF0C;&#x6CE8;&#x610F;x&#xFF0C;y&#x542B;&#x4E49;</span>
plt.barh(
    x, <span class="hljs-comment"># &#x6A2A;&#x6761;&#x79BB;&#x5F00;x&#x8F74;&#x7684;&#x8DDD;&#x79BB;</span>
    y, <span class="hljs-comment"># &#x6A2A;&#x6761;&#x957F;&#x5EA6;</span>

    height=<span class="hljs-number">0.5</span>, <span class="hljs-comment"># &#x6A2A;&#x6761;&#x7C97;&#x7EC6;</span>
    color=<span class="hljs-string">&apos;r&apos;</span>,  <span class="hljs-comment">#&#x989C;&#x8272;</span>
    alpha =<span class="hljs-number">0.6</span>,  <span class="hljs-comment">#&#x900F;&#x660E;&#x5EA6;</span>
)
<span class="hljs-comment"># y&#x8F74;&#x6807;&#x6CE8;</span>
plt.yticks(x,[<span class="hljs-string">&apos;a&apos;</span>,<span class="hljs-string">&apos;b&apos;</span>,<span class="hljs-string">&apos;c&apos;</span>,<span class="hljs-string">&apos;d&apos;</span>,<span class="hljs-string">&apos;e&apos;</span>])
plt.show()
</code></pre>
<p><img src="images/output_30_0.png" alt="png"></p>
<p>&#x591A;&#x4E2A;&#x56FE;&#x8868;&#x53EF;&#x7ED8;&#x5236;&#x5230;&#x4E00;&#x5F20;&#x56FE;&#x4E2D;</p>
<pre><code class="lang-python">plt.bar(x,y)
plt.barh(x,y)
plt.show()
</code></pre>
<p><img src="images/output_32_0.png" alt="png"></p>
<h2 id="&#x6848;&#x4F8B;&#xFF1A;&#x67D0;&#x73ED;&#x7EA7;&#x7537;&#x751F;&#x548C;&#x5973;&#x751F;&#x5404;&#x79D1;&#x6210;&#x7EE9;&#x5E73;&#x5747;&#x5206;&#x6570;&#x636E;&#x53EF;&#x89C6;&#x5316;">&#x6848;&#x4F8B;&#xFF1A;&#x67D0;&#x73ED;&#x7EA7;&#x7537;&#x751F;&#x548C;&#x5973;&#x751F;&#x5404;&#x79D1;&#x6210;&#x7EE9;&#x5E73;&#x5747;&#x5206;&#x6570;&#x636E;&#x53EF;&#x89C6;&#x5316;</h2>
<table>
<thead>
<tr>
<th>&#x5B66;&#x79D1;</th>
<th>&#x7537;&#x751F;</th>
<th>&#x5973;&#x751F;</th>
</tr>
</thead>
<tbody>
<tr>
<td>&#x8BED;&#x6587;</td>
<td>85.5</td>
<td>94</td>
</tr>
<tr>
<td>&#x6570;&#x5B66;</td>
<td>91</td>
<td>82</td>
</tr>
<tr>
<td>&#x82F1;&#x8BED;</td>
<td>72</td>
<td>89.5</td>
</tr>
<tr>
<td>&#x7269;&#x7406;</td>
<td>59</td>
<td>62</td>
</tr>
<tr>
<td>&#x5316;&#x5B66;</td>
<td>66</td>
<td>49</td>
</tr>
</tbody>
</table>
<pre><code class="lang-python"><span class="hljs-comment">#&#x7537;&#x751F;&#x5E73;&#x5747;&#x5206;&#xFF0C;&#x8BED;&#x6587; &#x6570;&#x5B66; &#x82F1;&#x8BED; &#x7269;&#x7406; &#x5316;&#x5B66; </span>
boy = [<span class="hljs-number">85.5</span>,<span class="hljs-number">91</span>,<span class="hljs-number">72</span>,<span class="hljs-number">59</span>,<span class="hljs-number">66</span>]
<span class="hljs-comment">#&#x5973;&#x751F;&#x5E73;&#x5747;&#x5206;</span>
girl = [<span class="hljs-number">94</span>,<span class="hljs-number">82</span>,<span class="hljs-number">89.5</span>,<span class="hljs-number">62</span>,<span class="hljs-number">49</span>]
<span class="hljs-comment">#&#x79D1;&#x76EE;</span>
course = [<span class="hljs-number">1</span>,<span class="hljs-number">2</span>,<span class="hljs-number">3</span>,<span class="hljs-number">4</span>,<span class="hljs-number">5</span>]
</code></pre>
<pre><code class="lang-python"><span class="hljs-comment"># &#x6761;&#x5F62;&#x56FE;&#xFF0C;&#x6CE8;&#x610F;x&#xFF0C;y&#x542B;&#x4E49;</span>
plt.figure(figsize=(<span class="hljs-number">14</span>,<span class="hljs-number">6</span>))
plt.bar(
    course,
    girl, <span class="hljs-comment"># &#x6A2A;&#x6761;&#x957F;&#x5EA6;</span>

    width = <span class="hljs-number">0.3</span>, <span class="hljs-comment"># &#x6A2A;&#x6761;&#x7C97;&#x7EC6;</span>
    color=<span class="hljs-string">&apos;red&apos;</span>,  <span class="hljs-comment">#&#x989C;&#x8272;</span>
    <span class="hljs-comment">#alpha =0.6,  #&#x900F;&#x660E;&#x5EA6;</span>
)
course2 = [<span class="hljs-number">1.3</span>,<span class="hljs-number">2.3</span>,<span class="hljs-number">3.3</span>,<span class="hljs-number">4.3</span>,<span class="hljs-number">5.3</span>]
plt.bar(
    course2,
    boy, <span class="hljs-comment"># &#x6A2A;&#x6761;&#x957F;&#x5EA6;</span>

    width = <span class="hljs-number">0.3</span>, <span class="hljs-comment"># &#x6A2A;&#x6761;&#x7C97;&#x7EC6;</span>
    color=<span class="hljs-string">&apos;green&apos;</span>,  <span class="hljs-comment">#&#x989C;&#x8272;</span>
    alpha =<span class="hljs-number">0.6</span>,  <span class="hljs-comment">#&#x900F;&#x660E;&#x5EA6;</span>
)
course3 = [<span class="hljs-number">1.15</span>,<span class="hljs-number">2.15</span>,<span class="hljs-number">3.15</span>,<span class="hljs-number">4.15</span>,<span class="hljs-number">5.15</span>]
plt.xticks(course3,[<span class="hljs-string">&apos;&#x8BED;&#x6587;&apos;</span>,<span class="hljs-string">&apos;&#x6570;&#x5B66;&apos;</span>,<span class="hljs-string">&apos;&#x82F1;&#x8BED;&apos;</span>,<span class="hljs-string">&apos;&#x7269;&#x7406;&apos;</span>,<span class="hljs-string">&apos;&#x5316;&#x5B66;&apos;</span>])
plt.title(<span class="hljs-string">&apos;12&#x73ED;&#x7EA7;&#x7537;&#x751F;&#x548C;&#x5973;&#x751F;&#x5404;&#x79D1;&#x6210;&#x7EE9;&#x5E73;&#x5747;&#x5206;&#x6570;&#x636E;&#x53EF;&#x89C6;&#x5316;&apos;</span>)
plt.grid(linewidth=<span class="hljs-number">0.3</span>)

<span class="hljs-comment">#&#x8FDB;&#x9636; &#x62D3;&#x5C55;</span>
<span class="hljs-comment">#plt.text(3,40,&apos;&#x5973;&#x751F;&apos;)  #&#x56FE;&#x50CF;&#x5185;&#x6DFB;&#x52A0;&#x6587;&#x5B57;</span>
<span class="hljs-keyword">for</span> i,j <span class="hljs-keyword">in</span> zip(course,girl):
<span class="hljs-comment">#     print(i)</span>
<span class="hljs-comment">#     print(j)</span>

    plt.text(
    i,
    j,
    <span class="hljs-string">&apos;%.1f&apos;</span> % j,  <span class="hljs-comment"># &#x6570;&#x636E;&#x8F6C;&#x4E3A;&#x4E00;&#x4F4D;&#x5C0F;&#x6570;</span>
        ha=<span class="hljs-string">&apos;center&apos;</span>, <span class="hljs-comment"># &#x6C34;&#x5E73;&#x5BF9;&#x9F50;</span>
        va=<span class="hljs-string">&apos;bottom&apos;</span>, <span class="hljs-comment"># &#x5782;&#x76F4;&#x5BF9;&#x9F50;</span>
        alpha = <span class="hljs-number">0.5</span>,
    )
<span class="hljs-keyword">for</span> i,j <span class="hljs-keyword">in</span> zip(course2,boy):
<span class="hljs-comment">#     print(i)</span>
<span class="hljs-comment">#     print(j)</span>

    plt.text(
    i,
    j,
    <span class="hljs-string">&apos;%.1f&apos;</span> % j,  <span class="hljs-comment"># &#x6570;&#x636E;&#x8F6C;&#x4E3A;&#x4E00;&#x4F4D;&#x5C0F;&#x6570;</span>
        ha=<span class="hljs-string">&apos;center&apos;</span>, <span class="hljs-comment"># &#x6C34;&#x5E73;&#x5BF9;&#x9F50;</span>
        va=<span class="hljs-string">&apos;bottom&apos;</span>, <span class="hljs-comment"># &#x5782;&#x76F4;&#x5BF9;&#x9F50;</span>
        alpha = <span class="hljs-number">0.5</span>,
    )
<span class="hljs-comment">###############       </span>

plt.show()
</code></pre>
<p><img src="images/output_36_0.png" alt="png"></p>
<pre><code class="lang-python">x 
boy
list(zip(x,boy))
</code></pre>
<pre><code>[(1, 85.5), (2, 91), (3, 72), (4, 59), (5, 66)]
</code></pre><hr>
<h1 id="&#x997C;&#x56FE;">&#x997C;&#x56FE;</h1>
<p>&#x997C;&#x56FE;&#x7528;&#x4E8E;&#x663E;&#x793A;&#x5404;&#x9879;&#x76F8;&#x5BF9;&#x603B;&#x548C;&#x7684;&#x767E;&#x5206;&#x6BD4;&#x5927;&#x5C0F;</p>
<pre><code class="lang-python">a = [<span class="hljs-number">1</span>,<span class="hljs-number">2</span>,<span class="hljs-number">3</span>,<span class="hljs-number">4</span>,<span class="hljs-number">5</span>,<span class="hljs-number">6</span>,<span class="hljs-number">7</span>,<span class="hljs-number">8</span>,<span class="hljs-number">9</span>,<span class="hljs-number">0</span>]

plt.pie(a)
plt.show()
</code></pre>
<p><img src="images/output_39_0.png" alt="png"></p>
<pre><code class="lang-python">a = range(<span class="hljs-number">1</span>,<span class="hljs-number">20</span>)

plt.pie(a)
plt.show()
</code></pre>
<p><img src="images/output_40_0.png" alt="png"></p>
<h2 id="&#x6848;&#x4F8B;&#xFF1A;2017&#x5E74;9&#x56FD;&#x519B;&#x8D39;&#x5360;&#x6BD4;&#x6570;&#x636E;&#x53EF;&#x89C6;&#x5316;">&#x6848;&#x4F8B;&#xFF1A;2017&#x5E74;9&#x56FD;&#x519B;&#x8D39;&#x5360;&#x6BD4;&#x6570;&#x636E;&#x53EF;&#x89C6;&#x5316;</h2>
<table>
<thead>
<tr>
<th>&#x56FD;&#x5BB6;</th>
<th>&#x519B;&#x8D39;&#x5360;&#x6BD4;</th>
</tr>
</thead>
<tbody>
<tr>
<td>&#x7F8E;&#x56FD;</td>
<td>0.5548467</td>
</tr>
<tr>
<td>&#x4E2D;&#x56FD;</td>
<td>0.14444868</td>
</tr>
<tr>
<td>&#x5370;&#x5EA6;</td>
<td>0.05094268</td>
</tr>
<tr>
<td>&#x6C99;&#x7279;</td>
<td>0.04846696</td>
</tr>
<tr>
<td>&#x4FC4;&#x56FD;</td>
<td>0.046753</td>
</tr>
<tr>
<td>&#x65E5;&#x672C;</td>
<td>0.04418206</td>
</tr>
<tr>
<td>&#x82F1;&#x56FD;</td>
<td>0.04161112</td>
</tr>
<tr>
<td>&#x5FB7;&#x56FD;</td>
<td>0.03799276</td>
</tr>
<tr>
<td>&#x6CD5;&#x56FD;</td>
<td>0.03075605</td>
</tr>
</tbody>
</table>
<pre><code class="lang-python"><span class="hljs-comment"># &#x56FD;&#x540D;</span>
mark = [<span class="hljs-string">&apos;America&apos;</span>,<span class="hljs-string">&apos;China&apos;</span>,<span class="hljs-string">&apos;India&apos;</span>,<span class="hljs-string">&apos;Saudi&apos;</span>,<span class="hljs-string">&apos;Russia&apos;</span>,<span class="hljs-string">&apos;Japan&apos;</span>,<span class="hljs-string">&apos;Britain&apos;</span>,<span class="hljs-string">&apos;Germany&apos;</span>,<span class="hljs-string">&apos;France&apos;</span>]
<span class="hljs-comment"># &#x5404;&#x56FD;&#x5360;9&#x56FD;&#x603B;&#x519B;&#x8D39;&#x7684;&#x6BD4;&#x4F8B;</span>
percent = [<span class="hljs-number">0.5548467</span>,<span class="hljs-number">0.14444868</span>,<span class="hljs-number">0.05094268</span>,<span class="hljs-number">0.04846696</span>,<span class="hljs-number">0.046753</span>,<span class="hljs-number">0.04418206</span>,<span class="hljs-number">0.04161112</span>,<span class="hljs-number">0.03799276</span>,<span class="hljs-number">0.03075605</span>]

plt.figure(figsize=(<span class="hljs-number">12</span>,<span class="hljs-number">12</span>))
plt.pie(
    percent,   <span class="hljs-comment">#&#x767E;&#x5206;&#x6BD4;</span>
    labels = mark, <span class="hljs-comment">#&#x540D;&#x79F0;</span>
    autopct=<span class="hljs-string">&apos;%1.1f%%&apos;</span>,  <span class="hljs-comment"># &#x663E;&#x793A;&#x767E;&#x5206;&#x6BD4;&#x65B9;&#x5F0F;</span>
    startangle=-<span class="hljs-number">108</span>,  <span class="hljs-comment"># &#x997C;&#x56FE;&#x8D77;&#x59CB;&#x7684;&#x89D2;&#x5EA6;,&#x5EA6;&#x6570;,&#x9ED8;&#x8BA4;0&#x4E3A;&#x53F3;&#x4FA7;&#x6C34;&#x5E73;180&#x5EA6;&#x5F00;&#x59CB;&#xFF0C;&#x9006;&#x65F6;&#x9488;&#x65CB;&#x8F6C;</span>
    explode=[<span class="hljs-number">0</span>,<span class="hljs-number">0.1</span>,<span class="hljs-number">0</span>,<span class="hljs-number">0</span>,<span class="hljs-number">0</span>,<span class="hljs-number">0</span>,<span class="hljs-number">0</span>,<span class="hljs-number">0</span>,<span class="hljs-number">0</span>],

)
plt.axis(<span class="hljs-string">&apos;equal&apos;</span>)  <span class="hljs-comment">#&#x6B63;&#x5706;&#x5F62;&#x997C;&#x56FE;,x/y&#x8F74;&#x5C3A;&#x5BF8;&#x76F8;&#x7B49;.&#x9ED8;&#x8BA4;&#x662F;&#x6241;&#x56FE;,</span>
plt.show()
</code></pre>
<p><img src="images/output_43_0.png" alt="png"></p>
<hr>
<h1 id="&#x76F4;&#x65B9;&#x56FE;">&#x76F4;&#x65B9;&#x56FE;</h1>
<p>&#x76F4;&#x65B9;&#x56FE;&#x662F;&#x8868;&#x8FBE;&#x6570;&#x636E;&#x7684;&#x5206;&#x5E03;&#x60C5;&#x51B5;&#x7684;&#x7EDF;&#x8BA1;&#x56FE;&#x8868;&#xFF0C;&#x4E00;&#x822C;&#x7528;&#x6765;&#x8868;&#x793A;&#x540C;&#x7B49;&#x533A;&#x95F4;&#x5185;,&#x67D0;&#x7C7B;&#x6570;&#x503C;&#x51FA;&#x73B0;&#x7684;&#x4E2A;&#x6570;&#x6216;&#x9891;&#x7387;(&#x9891;&#x7387;=&#x51FA;&#x73B0;&#x6B21;&#x6570;/&#x603B;&#x6570;)</p>
<ul>
<li>x&#x8F74;&#x8868;&#x793A;&#x5206;&#x7EC4;&#x6570;&#x636E;&#xFF0C;y&#x8F74;&#x8868;&#x793A;&#x5206;&#x5E03;&#x60C5;&#x51B5;</li>
<li>&#x4ECE;&#x9891;&#x7387;&#x5206;&#x5E03;&#x76F4;&#x65B9;&#x56FE;&#x53EF;&#x4EE5;&#x76F4;&#x89C2;&#x4F30;&#x8BA1;&#x51FA;&#xFF1A;<ul>
<li>&#x4F17; &#x6570;&#xFF1A;&#x9891;&#x7387;&#x5206;&#x5E03;&#x76F4;&#x65B9;&#x56FE;&#x4E2D;&#x6700;&#x9AD8;&#x77E9;&#x5F62;&#x7684;&#x5E95;&#x8FB9;&#x4E2D;&#x70B9;&#x7684;&#x6A2A;&#x5750;&#x6807;</li>
<li>&#x4E2D;&#x4F4D;&#x6570;&#xFF1A;&#x628A;&#x9891;&#x7387;&#x5206;&#x5E03;&#x76F4;&#x65B9;&#x56FE;&#x5206;&#x6210;&#x4E24;&#x4E2A;&#x9762;&#x79EF;&#x76F8;&#x7B49;&#x90E8;&#x5206;&#x7684;&#x5E73;&#x884C;&#x4E8E;Y&#x8F74;&#x7684;&#x76F4;&#x7EBF;&#x6A2A;&#x5750;&#x6807;</li>
</ul>
</li>
</ul>
<h4 id="&#x76F4;&#x65B9;&#x56FE;&#x4E0E;&#x67F1;&#x72B6;&#x56FE;&#x7684;&#x533A;&#x522B;&#xFF1A;">&#x76F4;&#x65B9;&#x56FE;&#x4E0E;&#x67F1;&#x72B6;&#x56FE;&#x7684;&#x533A;&#x522B;&#xFF1A;</h4>
<ul>
<li>&#x76F4;&#x65B9;&#x56FE;&#xFF1A;&#x5206;&#x533A;&#x4E4B;&#x95F4;&#x8FDE;&#x7EED;&#x65E0;&#x95F4;&#x65AD;&#xFF0C;&#x8868;&#x793A;&#x8FDE;&#x7EED;&#x53D8;&#x91CF;&#xFF1B;&#x503C;&#x7528;&#x77E9;&#x5F62;&#x9762;&#x79EF;&#x8868;&#x793A;</li>
<li>&#x6761;&#x5F62;&#x56FE;&#xFF1A;&#x5404;&#x67F1;&#x4E4B;&#x95F4;&#x6709;&#x95F4;&#x9699;&#xFF0C;&#x8868;&#x793A;&#x5B64;&#x7ACB;&#x7684;&#x3001;&#x4E0D;&#x8FDE;&#x7EED;&#x5206;&#x7C7B;&#x53D8;&#x91CF;&#xFF1B;&#x503C;&#x7528;&#x77E9;&#x5F62;&#x957F;&#x5EA6;&#x8868;&#x793A;</li>
</ul>
<p>&#x76F4;&#x65B9;&#x56FE;&#x9002;&#x7528;&#x4E8E;&#x5927;&#x4E8E;30&#x6761;&#x6570;&#x636E;&#x7684;&#x5206;&#x5E03;&#x60C5;&#x51B5;&#x67E5;&#x770B;</p>
<h3 id="&#x6848;&#x4F8B;&#xFF1A;1&#x73ED;&#x548C;2&#x73ED;&#x8BED;&#x6587;&#x6210;&#x7EE9;&#x7EDF;&#x8BA1;&#x6570;&#x636E;&#x53EF;&#x89C6;&#x5316;">&#x6848;&#x4F8B;&#xFF1A;1&#x73ED;&#x548C;2&#x73ED;&#x8BED;&#x6587;&#x6210;&#x7EE9;&#x7EDF;&#x8BA1;&#x6570;&#x636E;&#x53EF;&#x89C6;&#x5316;</h3>
<pre><code class="lang-python"><span class="hljs-comment"># &#x6210;&#x7EE9;&#x6570;&#x636E;</span>
h1 = [ <span class="hljs-number">88.2</span>,  <span class="hljs-number">83.5</span>,  <span class="hljs-number">68.8</span>,  <span class="hljs-number">85.4</span>,  <span class="hljs-number">78.6</span>,  <span class="hljs-number">69.3</span>,  <span class="hljs-number">60.6</span>,  <span class="hljs-number">91.2</span>,  <span class="hljs-number">52.7</span>,
        <span class="hljs-number">85.9</span>,  <span class="hljs-number">57.1</span>,  <span class="hljs-number">68.</span> ,  <span class="hljs-number">66.6</span>,  <span class="hljs-number">78.2</span>,  <span class="hljs-number">78.8</span>,  <span class="hljs-number">85.</span> ,  <span class="hljs-number">89.1</span>,  <span class="hljs-number">74.4</span>,
        <span class="hljs-number">93.6</span>,  <span class="hljs-number">75.7</span>,  <span class="hljs-number">54.3</span>,  <span class="hljs-number">55.</span> ,  <span class="hljs-number">90.9</span>,  <span class="hljs-number">79.4</span>,  <span class="hljs-number">94.4</span>,  <span class="hljs-number">86.7</span>,  <span class="hljs-number">82.4</span>,
        <span class="hljs-number">76.7</span>,  <span class="hljs-number">78.7</span>,  <span class="hljs-number">72.3</span>,  <span class="hljs-number">83.9</span>,  <span class="hljs-number">78.6</span>,  <span class="hljs-number">80.</span> ,  <span class="hljs-number">70.5</span>,  <span class="hljs-number">87.1</span>,  <span class="hljs-number">80.3</span>,
        <span class="hljs-number">87.9</span>,  <span class="hljs-number">65.1</span>,  <span class="hljs-number">67.4</span>,  <span class="hljs-number">61.5</span>,  <span class="hljs-number">49.7</span>,  <span class="hljs-number">77.1</span>,  <span class="hljs-number">91.4</span>,  <span class="hljs-number">72.</span> ,  <span class="hljs-number">61.5</span>,
        <span class="hljs-number">73.9</span>,  <span class="hljs-number">76.9</span>,  <span class="hljs-number">88.2</span>,  <span class="hljs-number">51.2</span>,  <span class="hljs-number">53.9</span>]

h2 = [ <span class="hljs-number">79.5</span>,  <span class="hljs-number">99.</span> ,  <span class="hljs-number">80.</span> ,  <span class="hljs-number">71.</span> ,  <span class="hljs-number">79.2</span>,  <span class="hljs-number">85.6</span>,  <span class="hljs-number">79.2</span>,  <span class="hljs-number">68.8</span>,  <span class="hljs-number">68.7</span>,
        <span class="hljs-number">96.5</span>,  <span class="hljs-number">63.8</span>,  <span class="hljs-number">81.8</span>,  <span class="hljs-number">76.9</span>,  <span class="hljs-number">80.</span> ,  <span class="hljs-number">73.8</span>,  <span class="hljs-number">77.1</span>,  <span class="hljs-number">79.6</span>,  <span class="hljs-number">76.8</span>,
        <span class="hljs-number">73.9</span>,  <span class="hljs-number">73.2</span>,  <span class="hljs-number">66.</span> ,  <span class="hljs-number">76.2</span>,  <span class="hljs-number">76.4</span>,  <span class="hljs-number">65.3</span>,  <span class="hljs-number">75.2</span>,  <span class="hljs-number">74.5</span>,  <span class="hljs-number">87.5</span>,
        <span class="hljs-number">78.4</span>,  <span class="hljs-number">95.</span> ,  <span class="hljs-number">72.6</span>,  <span class="hljs-number">86.</span> ,  <span class="hljs-number">71.7</span>,  <span class="hljs-number">71.</span> ,  <span class="hljs-number">87.7</span>,  <span class="hljs-number">83.9</span>,  <span class="hljs-number">76.8</span>,
        <span class="hljs-number">72.3</span>,  <span class="hljs-number">67.</span> ,  <span class="hljs-number">67.8</span>,  <span class="hljs-number">79.6</span>,  <span class="hljs-number">81.9</span>,  <span class="hljs-number">83.</span> ,  <span class="hljs-number">65.6</span>,  <span class="hljs-number">91.6</span>,  <span class="hljs-number">75.5</span>,
        <span class="hljs-number">77.6</span>,  <span class="hljs-number">82.8</span>,  <span class="hljs-number">87.5</span>,  <span class="hljs-number">75.1</span>,  <span class="hljs-number">79.4</span>]
</code></pre>
<pre><code class="lang-python"><span class="hljs-comment"># 1&#x73ED;&#x6210;&#x7EE9;&#x76F4;&#x65B9;&#x56FE;</span>
plt.hist(h1)

plt.show()
</code></pre>
<p><img src="images/output_47_0.png" alt="png"></p>
<pre><code class="lang-python">plt.hist(
    h1,  <span class="hljs-comment"># &#x76F4;&#x65B9;&#x56FE;&#x6570;&#x636E;</span>
    <span class="hljs-number">10</span>,  <span class="hljs-comment"># &#x76F4;&#x65B9;&#x4E2A;&#x6570;</span>
    density=<span class="hljs-number">0</span>,  <span class="hljs-comment"># &#x9ED8;&#x8BA4;0 &#x6570;&#x636E;&#x51FA;&#x73B0;&#x4E2A;&#x6570;&#xFF0C;1 &#x51FA;&#x73B0;&#x4E2A;&#x6570;&#x5F52;&#x4E00;&#x5316;&#x4E3A;&#x51FA;&#x73B0;&#x7684;&#x9891;&#x7387;</span>
    histtype=<span class="hljs-string">&apos;bar&apos;</span>,  <span class="hljs-comment"># &#x76F4;&#x65B9;&#x56FE;&#x6837;&#x5F0F;&#xFF1A;&#x9ED8;&#x8BA4;bar&#xFF0C;stepfilled&#x586B;&#x5145;&#x989C;&#x8272;&#xFF0C;step&#x4E0D;&#x586B;&#x5145;&#x53EA;&#x6709;&#x7EBF;&#x6761;</span>
    facecolor=<span class="hljs-string">&apos;b&apos;</span>,  <span class="hljs-comment"># &#x76F4;&#x65B9;&#x56FE;&#x989C;&#x8272;</span>
    <span class="hljs-comment">#edgecolor = &apos;r&apos;,  # &#x76F4;&#x65B9;&#x56FE;&#x8FB9;&#x6846;&#x989C;&#x8272;</span>
    alpha=<span class="hljs-number">0.3</span>,
)
plt.hist(h2,<span class="hljs-number">10</span>,alpha=<span class="hljs-number">0.3</span>)
</code></pre>
<pre><code>(array([ 5.,  3.,  8., 11.,  9.,  5.,  5.,  1.,  1.,  2.]),
 array([63.8 , 67.32, 70.84, 74.36, 77.88, 81.4 , 84.92, 88.44, 91.96,
        95.48, 99.  ]),
 &lt;a list of 10 Patch objects&gt;)
</code></pre><p><img src="images/output_48_1.png" alt="png"></p>
<hr>
<h1 id="&#x7BB1;&#x7EBF;&#x56FE;">&#x7BB1;&#x7EBF;&#x56FE;</h1>
<p>&#x7BB1;&#x7EBF;&#x56FE;&#x53C8;&#x540D;&#x76D2;&#x987B;&#x56FE;&#xFF0C;&#x662F;&#x4E00;&#x79CD;&#x7528;&#x4F5C;&#x663E;&#x793A;&#x4E00;&#x7EC4;&#x6570;&#x636E;&#x79BB;&#x6563;&#x60C5;&#x51B5;&#x7684;&#x7EDF;&#x8BA1;&#x56FE;&#x8868;&#xFF0C;&#x5E38;&#x7528;&#x4F5C;&#x591A;&#x7EC4;&#x6570;&#x636E;&#x7684;&#x7EFC;&#x5408;&#x7EDF;&#x8BA1;&#x6BD4;&#x8F83;</p>
<p>&#x56DB;&#x5206;&#x4F4D;&#x6570;&#xFF1A;</p>
<ul>
<li>&#x7B2C;&#x4E00;&#x56DB;&#x5206;&#x4F4D;&#x6570;(Q1)&#xFF0C;&#x53C8;&#x79F0;&#x201C;&#x8F83;&#x5C0F;&#x56DB;&#x5206;&#x4F4D;&#x6570;&#x201D;&#xFF0C;&#x7B49;&#x4E8E;&#x8BE5;&#x6837;&#x672C;&#x4E2D;&#x6240;&#x6709;&#x6570;&#x503C;&#x7531;&#x5C0F;&#x5230;&#x5927;&#x6392;&#x5217;&#x540E;&#x7B2C;25%&#x7684;&#x6570;&#x5B57;&#x3002;</li>
<li>&#x7B2C;&#x4E8C;&#x56DB;&#x5206;&#x4F4D;&#x6570;(Q2)&#xFF0C;&#x53C8;&#x79F0;&#x201C;&#x4E2D;&#x4F4D;&#x6570;&#x201D;&#xFF0C;&#x7B49;&#x4E8E;&#x8BE5;&#x6837;&#x672C;&#x4E2D;&#x6240;&#x6709;&#x6570;&#x503C;&#x7531;&#x5C0F;&#x5230;&#x5927;&#x6392;&#x5217;&#x540E;&#x7B2C;50%&#x7684;&#x6570;&#x5B57;&#x3002;</li>
<li>&#x7B2C;&#x4E09;&#x56DB;&#x5206;&#x4F4D;&#x6570;(Q3)&#xFF0C;&#x53C8;&#x79F0;&#x201C;&#x8F83;&#x5927;&#x56DB;&#x5206;&#x4F4D;&#x6570;&#x201D;&#xFF0C;&#x7B49;&#x4E8E;&#x8BE5;&#x6837;&#x672C;&#x4E2D;&#x6240;&#x6709;&#x6570;&#x503C;&#x7531;&#x5C0F;&#x5230;&#x5927;&#x6392;&#x5217;&#x540E;&#x7B2C;75%&#x7684;&#x6570;&#x5B57;&#x3002;</li>
</ul>
<p>&#x7BB1;&#x7EBF;&#x56FE;&#x4E3B;&#x8981;&#x5305;&#x542B;5&#x4E2A;&#x7EDF;&#x8BA1;&#x91CF;&#xFF0C;&#x4ECE;&#x4E0A;&#x5230;&#x4E0B;&#xFF0C;&#x4ECE;&#x9AD8;&#x5230;&#x4F4E;&#xFF1A;</p>
<ul>
<li>&#x6700;&#x5927;&#x975E;&#x5F02;&#x5E38;&#x503C;&#xFF0C;&#x4E0A;&#x8FB9;&#x7EBF;</li>
<li>Q3&#xFF0C;&#x7BB1;&#x4F53;&#x4E0A;&#x8FB9;&#x7F18;&#x4E0A;&#x56DB;&#x5206;&#x4F4D;&#x6570;</li>
<li>Q2&#xFF0C;&#x4E2D;&#x4F4D;&#x6570;&#x7EBF;</li>
<li>Q1&#xFF0C;&#x7BB1;&#x4F53;&#x4E0B;&#x8FB9;&#x7F18;&#x4E0B;&#x56DB;&#x5206;&#x4F4D;&#x6570;</li>
<li>&#x6700;&#x5C0F;&#x975E;&#x5F02;&#x5E38;&#x503C;&#xFF0C;&#x4E0B;&#x8FB9;&#x7EBF;</li>
</ul>
<p>&#x9664;&#x4E86;&#x4E0A;&#x9762;5&#x4E2A;&#x7EDF;&#x8BA1;&#x91CF;&#xFF0C;&#x4E0A;&#x4E0B;&#x8FB9;&#x7F18;&#x5916;&#x4FA7;&#x53EF;&#x80FD;&#x8FD8;&#x6709;&#x5F02;&#x5E38;&#x503C;</p>
<ul>
<li>Q3&#x548C;Q1&#x7684;&#x5DEE;&#x503C;&#xFF0C;&#x5373;&#x56DB;&#x5206;&#x4F4D;&#x6570;&#x5DEE;</li>
<li>&#x5927;&#x4E8E;Q3 1.5&#x500D;&#x56DB;&#x5206;&#x4F4D;&#x6570;&#x5DEE;&#x7684;&#x503C;&#xFF0C;&#x6216;&#x8005;&#x5C0F;&#x4E8E;Q1 1.5&#x500D;&#x56DB;&#x5206;&#x4F4D;&#x6570;&#x5DEE;&#x7684;&#x503C;&#xFF0C;&#x5212;&#x4E3A;&#x5F02;&#x5E38;&#x503C;</li>
</ul>
<pre><code class="lang-python">a = [<span class="hljs-number">15</span>,<span class="hljs-number">5</span>,<span class="hljs-number">9</span>,<span class="hljs-number">22</span>,<span class="hljs-number">4</span>,-<span class="hljs-number">5</span>,<span class="hljs-number">45</span>,-<span class="hljs-number">22</span>]

plt.boxplot(a)

plt.show()
</code></pre>
<p><img src="images/output_50_0.png" alt="png"></p>
<h2 id="&#x6848;&#x4F8B;&#xFF1A;&#x67D0;&#x73ED;&#x7EA7;abc&#x4E09;&#x7EC4;&#x5B66;&#x5458;&#x6570;&#x5B66;&#x6210;&#x7EE9;&#x7EDF;&#x8BA1;&#x5206;&#x6790;&#x53EF;&#x89C6;&#x5316;">&#x6848;&#x4F8B;&#xFF1A;&#x67D0;&#x73ED;&#x7EA7;a/b/c&#x4E09;&#x7EC4;&#x5B66;&#x5458;&#x6570;&#x5B66;&#x6210;&#x7EE9;&#x7EDF;&#x8BA1;&#x5206;&#x6790;&#x53EF;&#x89C6;&#x5316;</h2>
<table>
<thead>
<tr>
<th>&#x7EC4;&#x522B;\&#x7F16;&#x53F7;</th>
<th>1</th>
<th>2</th>
<th>3</th>
<th>4</th>
<th>5</th>
<th>6</th>
<th>7</th>
<th>8</th>
</tr>
</thead>
<tbody>
<tr>
<td>a</td>
<td>42</td>
<td>55</td>
<td>79</td>
<td>68</td>
<td>15</td>
<td>98</td>
<td></td>
</tr>
<tr>
<td>b</td>
<td>32</td>
<td>59</td>
<td>77</td>
<td>100</td>
<td>92</td>
<td>88</td>
<td>5</td>
<td>0</td>
</tr>
<tr>
<td>c</td>
<td>92</td>
<td>98</td>
<td>78</td>
<td>65</td>
<td>97</td>
<td>100</td>
<td>0</td>
<td></td>
</tr>
</tbody>
</table>
<pre><code class="lang-python">a = [<span class="hljs-number">42</span>,<span class="hljs-number">55</span>,<span class="hljs-number">79</span>,<span class="hljs-number">68</span>,<span class="hljs-number">15</span>,<span class="hljs-number">98</span>]
b = [<span class="hljs-number">32</span>,<span class="hljs-number">59</span>,<span class="hljs-number">77</span>,<span class="hljs-number">100</span>,<span class="hljs-number">92</span>,<span class="hljs-number">88</span>,<span class="hljs-number">5</span>,<span class="hljs-number">0</span>]
c = [<span class="hljs-number">92</span>,<span class="hljs-number">98</span>,<span class="hljs-number">78</span>,<span class="hljs-number">65</span>,<span class="hljs-number">97</span>,<span class="hljs-number">100</span>,<span class="hljs-number">0</span>]
</code></pre>
<pre><code class="lang-python">
plt.figure(figsize=(<span class="hljs-number">12</span>,<span class="hljs-number">6</span>))
plt.boxplot(
    (a,c,b),<span class="hljs-comment"># &#x6570;&#x636E;</span>
    labels = (<span class="hljs-string">&apos;a&apos;</span>,<span class="hljs-string">&apos;c&apos;</span>,<span class="hljs-string">&apos;b&apos;</span>),
    showfliers = <span class="hljs-keyword">True</span>,  <span class="hljs-comment"># &#x662F;&#x5426;&#x663E;&#x793A;&#x5F02;&#x5E38;&#x503C;&#xFF0C;&#x9ED8;&#x8BA4;&#x663E;&#x793A;</span>
    whis = <span class="hljs-number">1.5</span>,  <span class="hljs-comment"># &#x6307;&#x5B9A;&#x5F02;&#x5E38;&#x503C;&#x53C2;&#x6570;&#xFF1A;&#x9ED8;&#x8BA4;1.5&#x500D;&#x56DB;&#x5206;&#x4F4D;&#x5DEE;</span>
    showmeans = <span class="hljs-keyword">True</span>, <span class="hljs-comment"># &#x662F;&#x5426;&#x663E;&#x793A;&#x5E73;&#x5747;&#x503C;&#xFF0C;&#x9ED8;&#x8BA4;&#x4E0D;&#x663E;&#x793A;</span>
    meanline = <span class="hljs-keyword">True</span>, <span class="hljs-comment"># &#x662F;&#x5426;&#x7528;&#x7EBF;&#x6807;&#x793A;&#x5E73;&#x5747;&#x503C;&#xFF0C;&#x9ED8;&#x8BA4;&#x7528;&#x70B9;</span>

    widths = <span class="hljs-number">0.5</span>, <span class="hljs-comment"># &#x67F1;&#x5B50;&#x5BBD;&#x5EA6;</span>

    vert = <span class="hljs-keyword">True</span>, <span class="hljs-comment"># &#x9ED8;&#x8BA4;True&#x7EB5;&#x5411;&#xFF0C;False&#x6A2A;&#x5411;</span>
    patch_artist = <span class="hljs-keyword">True</span>,  <span class="hljs-comment"># &#x662F;&#x5426;&#x586B;&#x5145;&#x989C;&#x8272;</span>
    boxprops = {<span class="hljs-string">&apos;facecolor&apos;</span>:<span class="hljs-string">&apos;#ffff00&apos;</span>,<span class="hljs-string">&apos;color&apos;</span>:<span class="hljs-string">&apos;green&apos;</span>}, <span class="hljs-comment"># &#x7BB1;&#x4F53;&#x6837;&#x5F0F;</span>
)
plt.show()
</code></pre>
<p><img src="images/output_53_0.png" alt="png"></p>
<p>&#x4E2D;&#x4F4D;&#x6570;&#x5BF9;&#x6781;&#x7AEF;&#x503C;&#x4E0D;&#x654F;&#x611F;</p>
<p>&#x5E73;&#x5747;&#x5206;&#x5BF9;&#x6781;&#x7AEF;&#x503C;&#x975E;&#x5E38;&#x654F;&#x611F;&#xFF08;&#x53BB;&#x6389;&#x6700;&#x9AD8;&#x5206;&#x6700;&#x4F4E;&#x5206;&#xFF09;</p>
<pre><code class="lang-python">&#x5355;&#x4E2A;&#x6570;&#x636E;&#x67E5;&#x770B;&#x6570;&#x636E;&#x5206;&#x5E03;&#x548C;&#x79BB;&#x6563;&#x7A0B;&#x5EA6;&#x7684;&#x56FE;&#x8868;

* &#x76F4;&#x65B9;&#x56FE;&#x662F;&#x4E2A;&#x5355;&#x4E2A;&#x6570;&#x636E;&#xFF0C;&#x4FE1;&#x606F;&#x66F4;&#x4E30;&#x5BCC;(&#x6570;&#x636E;&#x4E0D;&#x80FD;&#x592A;&#x5C11;&#xFF0C;&#x4E00;&#x822C;&#x4E0D;&#x80FD;&#x5C11;&#x4E8E;<span class="hljs-number">30</span>&#x6761;)
* &#x7BB1;&#x7EBF;&#x56FE;&#x9002;&#x5408;&#x591A;&#x4E2A;&#x6570;&#x636E;&#x6BD4;&#x8F83;
</code></pre>
<h2 id="&#x70ED;&#x529B;&#x56FE;">&#x70ED;&#x529B;&#x56FE;</h2>
<p>&#x70ED;&#x529B;&#x56FE;&#x4EE5;&#x4E8C;&#x7EF4;&#x5F62;&#x5F0F;&#x5C55;&#x793A;&#x6570;&#x636E;&#x7684;&#x5927;&#x5C0F;&#xFF0C;&#x4E3B;&#x8981;&#x7528;&#x4E8E;&#x6570;&#x636E;&#x7684;&#x91CD;&#x8981;&#x7A0B;&#x5EA6;&#xFF0F;&#x76F8;&#x5173;&#x5EA6;&#x5C55;&#x793A;</p>
<pre><code class="lang-python">a = [
    [<span class="hljs-number">1</span>, <span class="hljs-number">2</span>, <span class="hljs-number">3</span>],
    [<span class="hljs-number">4</span>, <span class="hljs-number">5</span>, <span class="hljs-number">6</span>],
    [<span class="hljs-number">7</span>, <span class="hljs-number">8</span>, <span class="hljs-number">9</span>]
]

plt.imshow(a)

plt.show()
</code></pre>
<p><img src="images/output_57_0.png" alt="png"></p>
<pre><code class="lang-python">plt.imshow(
    a,  <span class="hljs-comment"># &#x6570;&#x636E;</span>
    cmap=<span class="hljs-string">&apos;gray&apos;</span>,  <span class="hljs-comment"># &#x914D;&#x8272;&#xFF0C;gray&#x7070;&#x5EA6;</span>
    origin=<span class="hljs-string">&apos;lower&apos;</span>, <span class="hljs-comment"># &#x6C34;&#x5E73;&#x7FFB;&#x8F6C;&#xFF0C;&#x9ED8;&#x8BA4;upper,lower</span>
    interpolation=<span class="hljs-string">&apos;lanczos&apos;</span>, <span class="hljs-comment"># &#x6E32;&#x67D3;&#xFF0C;&#x6A21;&#x7CCA;</span>
)

plt.colorbar() <span class="hljs-comment">#&#x4FA7;&#x680F;</span>

plt.show()
</code></pre>
<p><img src="images/output_58_0.png" alt="png"></p>
<h3 id="&#x53E0;&#x52A0;&#x56FE;&#x50CF;&#x5230;&#x80CC;&#x666F;&#x4E0A;">&#x53E0;&#x52A0;&#x56FE;&#x50CF;&#x5230;&#x80CC;&#x666F;&#x4E0A;</h3>
<pre><code class="lang-python">img = plt.imread(<span class="hljs-string">&apos;xiangnong.jpg&apos;</span>)  <span class="hljs-comment"># &#x5C06;&#x56FE;&#x50CF;&#x8F6C;&#x4E3A;&#x6570;&#x7EC4;</span>
extent = (<span class="hljs-number">0</span>, <span class="hljs-number">25</span>, <span class="hljs-number">0</span>, <span class="hljs-number">25</span>)  <span class="hljs-comment"># &#x6309; &#x5DE6;&#x53F3;&#x4E0B;&#x4E0A; &#x4F4D;&#x7F6E;&#x62C9;&#x4F38;&#x586B;&#x5145;&#x56FE;&#x50CF;</span>
plt.imshow(img, extent=extent)

<span class="hljs-comment"># &#x5C06;&#x65B0;&#x56FE;&#x53E0;&#x52A0;&#x5230;&#x4E0A;&#x56FE;&#x4E4B;&#x4E0A;</span>
plt.scatter([<span class="hljs-number">12.5</span>, <span class="hljs-number">15.5</span>],[<span class="hljs-number">19</span>, <span class="hljs-number">19.5</span>], s=[<span class="hljs-number">100</span>, <span class="hljs-number">200</span>], color=<span class="hljs-string">&apos;g&apos;</span>, alpha=<span class="hljs-number">0.7</span>)

plt.show()
</code></pre>
<p><img src="images/output_60_0.png" alt="png"></p>
<pre><code class="lang-python">plt.figure(figsize=(<span class="hljs-number">10</span>,<span class="hljs-number">12</span>))
img = plt.imread(<span class="hljs-string">&apos;06.jpg&apos;</span>)  <span class="hljs-comment"># &#x5C06;&#x56FE;&#x50CF;&#x8F6C;&#x4E3A;&#x6570;&#x7EC4;</span>
extent = (<span class="hljs-number">0</span>, <span class="hljs-number">200</span>, <span class="hljs-number">0</span>, <span class="hljs-number">200</span>)  <span class="hljs-comment"># &#x6309; &#x5DE6;&#x53F3;&#x4E0B;&#x4E0A; &#x4F4D;&#x7F6E;&#x62C9;&#x4F38;&#x586B;&#x5145;&#x56FE;&#x50CF;</span>
plt.imshow(img, extent=extent)

<span class="hljs-comment"># &#x5C06;&#x65B0;&#x56FE;&#x53E0;&#x52A0;&#x5230;&#x4E0A;&#x56FE;&#x4E4B;&#x4E0A;</span>
plt.scatter([<span class="hljs-number">110</span>,<span class="hljs-number">100</span> ],[<span class="hljs-number">150</span>,<span class="hljs-number">155</span>], s=[<span class="hljs-number">90</span>, <span class="hljs-number">100</span>], color=<span class="hljs-string">&apos;r&apos;</span>, alpha=<span class="hljs-number">0.7</span>)

plt.show()
</code></pre>
<p><img src="images/output_61_0.png" alt="png"></p>

                    
                    </section>
                
                
                </div>
            </div>
        </div>

        
        <a href="../../Python可视化/绘图库-Matplotlib.html" class="navigation navigation-prev " aria-label="Previous page: Python可视化"><i class="fa fa-angle-left"></i></a>
        
        
        <a href="../../Python可视化/绘图库-Matplotlib/Matplotlib常见设置和操作.html" class="navigation navigation-next " aria-label="Next page: Matplotlib常见设置和操作"><i class="fa fa-angle-right"></i></a>
        
    </div>
</div>

        
<script src="../../gitbook/app.js"></script>

    
    <script src="../../gitbook/plugins/gitbook-plugin-search/lunr.min.js"></script>
    

    
    <script src="../../gitbook/plugins/gitbook-plugin-search/search.js"></script>
    

    
    <script src="../../gitbook/plugins/gitbook-plugin-sharing/buttons.js"></script>
    

    
    <script src="../../gitbook/plugins/gitbook-plugin-fontsettings/buttons.js"></script>
    

<script>
require(["gitbook"], function(gitbook) {
    var config = {"highlight":{},"search":{"maxIndexSize":1000000},"sharing":{"facebook":true,"twitter":true,"google":false,"weibo":false,"instapaper":false,"vk":false,"all":["facebook","google","twitter","weibo","instapaper"]},"fontsettings":{"theme":"white","family":"sans","size":2}};
    gitbook.start(config);
});
</script>

        
    </body>
    
</html>
